/* ==========================================================================
   TANUVAS Recruitment Portal — public home page
   Scoped to the candidate category landing page. Does not affect app.css,
   the dashboard shell, or any authenticated view.
   ========================================================================== */

:root {
    --portal-primary:        #12315C;
    --portal-primary-deep:   #0C2140;
    --portal-secondary:      #255CA8;
    --portal-teal:           #008D88;
    --portal-emerald:        #1C9B66;
    --portal-accent:         #F5A623;

    --portal-bg:             #F4F6FA;
    --portal-surface:        #FFFFFF;
    --portal-surface-alt:    #EEF2F8;

    --portal-text:           #16202E;
    --portal-muted:          #5A6879;
    --portal-border:         #DDE4EE;
    --portal-border-strong:  #C3CEDD;

    --portal-shadow:         0 1px 2px rgba(18, 49, 92, .06), 0 12px 32px -12px rgba(18, 49, 92, .16);
    --portal-shadow-hover:   0 2px 4px rgba(18, 49, 92, .08), 0 24px 48px -16px rgba(18, 49, 92, .28);

    --portal-radius:         20px;
    --portal-radius-sm:      10px;

    --portal-container:      1280px;

    --portal-font:           'Inter', 'Noto Sans Tamil', 'Segoe UI', 'Nirmala UI', system-ui, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.portal-home {
    margin: 0;
    background: var(--portal-bg);
    color: var(--portal-text);
    font-family: var(--portal-font);
    font-size: 16px;
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.portal-container {
    width: 100%;
    max-width: var(--portal-container);
    margin: 0 auto;
    padding-inline: 32px;
}

.portal-skip {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    background: var(--portal-primary);
    color: #fff;
    padding: 12px 20px;
    border-radius: 0 0 var(--portal-radius-sm) 0;
}

.portal-skip:focus { left: 0; }

.portal-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Header ------------------------------------------------------ */

.portal-header {
    background: var(--portal-surface);
    border-bottom: 1px solid var(--portal-border);
    position: relative;
    z-index: 5;
}

.portal-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 84px;
    padding-block: 14px;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

/* Replace .portal-brand__mark with <img class="portal-brand__logo"> when the
   official emblem file is available. */
.portal-brand__mark {
    flex: none;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(140deg, var(--portal-primary), var(--portal-secondary));
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .04em;
}

.portal-brand__logo {
    flex: none;
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.portal-brand__text { min-width: 0; }

.portal-brand__name {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.01em;
    color: var(--portal-primary);
}

.portal-brand__sub {
    margin: 2px 0 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--portal-muted);
    letter-spacing: .02em;
}

.portal-header__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: none;
}

.portal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    padding: 11px 22px;
    border: 1px solid transparent;
    border-radius: 999px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.portal-btn:focus-visible {
    outline: 3px solid var(--portal-accent);
    outline-offset: 3px;
}

.portal-btn--ghost {
    background: transparent;
    border-color: var(--portal-border-strong);
    color: var(--portal-primary);
}

.portal-btn--ghost:hover {
    background: var(--portal-surface-alt);
    border-color: var(--portal-secondary);
}

/* ---------- Hero -------------------------------------------------------- */

.portal-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--portal-primary-deep) 0%, var(--portal-primary) 45%, var(--portal-secondary) 100%);
    color: #fff;
}

.portal-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .16) 1px, transparent 1px);
    background-size: 22px 22px;
    opacity: .5;
}

.portal-hero__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(10px);
    pointer-events: none;
}

.portal-hero__glow--teal {
    width: 420px;
    height: 420px;
    right: -120px;
    top: -160px;
    background: radial-gradient(circle, rgba(0, 141, 136, .55) 0%, transparent 68%);
}

.portal-hero__glow--accent {
    width: 340px;
    height: 340px;
    left: -110px;
    bottom: -180px;
    background: radial-gradient(circle, rgba(245, 166, 35, .38) 0%, transparent 70%);
}

.portal-hero__inner {
    position: relative;
    z-index: 1;
    padding-block: 60px 68px;
    max-width: 780px;
}

.portal-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 18px;
    padding: 7px 16px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.portal-hero__title {
    margin: 0;
    font-size: clamp(30px, 4.4vw, 46px);
    font-weight: 700;
    line-height: 1.14;
    letter-spacing: -.02em;
    text-wrap: balance;
}

.portal-hero__tamil {
    margin: 14px 0 0;
    font-size: clamp(16px, 2vw, 19px);
    font-weight: 500;
    color: rgba(255, 255, 255, .92);
}

.portal-hero__lede {
    margin: 14px 0 0;
    font-size: 16.5px;
    color: rgba(255, 255, 255, .82);
    max-width: 60ch;
}

/* ---------- Section shell ---------------------------------------------- */

.portal-section { padding-block: 64px; }
.portal-section--tight { padding-block: 0 72px; }

.portal-section__head {
    max-width: 720px;
    margin: 0 0 40px;
}

.portal-section__title {
    margin: 0;
    font-size: clamp(24px, 3vw, 31px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.015em;
    color: var(--portal-primary);
    text-wrap: balance;
}

.portal-section__tamil {
    margin: 8px 0 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--portal-text);
}

.portal-section__lede {
    margin: 8px 0 0;
    font-size: 15.5px;
    color: var(--portal-muted);
    max-width: 62ch;
}

/* ---------- Category cards --------------------------------------------- */

.portal-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
    align-items: stretch;
}

.portal-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius);
    box-shadow: var(--portal-shadow);
    padding: 40px 30px 30px;
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.portal-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 6px;
    background: var(--card-accent, var(--portal-primary));
}

.portal-card--uo  { --card-accent: linear-gradient(90deg, #12315C, #255CA8 55%, #008D88); --card-tint: #EAF1FB; --card-ink: #12315C; }
.portal-card--ap  { --card-accent: linear-gradient(90deg, #D97706, #F5A623 55%, #1C9B66); --card-tint: #FDF3E3; --card-ink: #8A4B06; }
.portal-card--cas { --card-accent: linear-gradient(90deg, #0E7490, #008D88 55%, #1C9B66); --card-tint: #E4F4F3; --card-ink: #0A5F5C; }

.portal-card--open:hover,
.portal-card--open:focus-within {
    transform: translateY(-4px);
    box-shadow: var(--portal-shadow-hover);
    border-color: var(--portal-border-strong);
}

.portal-card--closed { background: linear-gradient(180deg, #FCFDFE, var(--portal-surface)); }

.portal-card__icon {
    width: 104px;
    height: 104px;
    margin: 0 0 24px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--card-tint);
    color: var(--card-ink);
    font-size: 44px;
    line-height: 1;
    flex: none;
    transition: transform .25s ease;
}

.portal-card--open:hover .portal-card__icon { transform: scale(1.04); }

.portal-card__icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.portal-card__title {
    margin: 0;
    font-size: 23px;
    font-weight: 700;
    line-height: 1.22;
    letter-spacing: -.015em;
    color: var(--portal-primary);
}

.portal-card__tamil {
    margin: 5px 0 0;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--portal-muted);
}

.portal-card__desc {
    margin: 16px 0 24px;
    font-size: 14.8px;
    color: var(--portal-muted);
    flex: 1;
}

.portal-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 24px;
    padding: 7px 15px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .01em;
    border: 1px solid transparent;
    align-self: flex-start;
}

.portal-badge__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: currentColor;
    flex: none;
}

.portal-badge--open {
    background: #E6F6EE;
    color: #10613F;
    border-color: #B9E4CE;
}

.portal-badge--open .portal-badge__dot { animation: portal-pulse 2.4s ease-in-out infinite; }

.portal-badge--soon {
    background: #FDF1DE;
    color: #8A4B06;
    border-color: #F3D9AC;
}

.portal-badge--closed {
    background: #EFF2F6;
    color: #4A5666;
    border-color: var(--portal-border-strong);
}

@keyframes portal-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .45; transform: scale(.82); }
}

.portal-card__cta {
    width: 100%;
    background: linear-gradient(135deg, var(--portal-primary), var(--portal-secondary));
    color: #fff;
}

.portal-card__cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px -8px rgba(18, 49, 92, .55);
}

.portal-card__cta .portal-arrow { transition: transform .2s ease; }
.portal-card__cta:hover .portal-arrow { transform: translateX(4px); }

.portal-card__cta--closed {
    width: 100%;
    background: var(--portal-surface-alt);
    color: #4A5666;
    border-color: var(--portal-border-strong);
    cursor: not-allowed;
}

/* ---------- Guidance ---------------------------------------------------- */

.portal-panel {
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius);
    box-shadow: var(--portal-shadow);
    padding: 40px;
}

.portal-panel .portal-section__head { margin-bottom: 32px; }

.portal-steps {
    list-style: none;
    counter-reset: portal-step;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 26px;
}

.portal-steps li {
    counter-increment: portal-step;
    padding-top: 52px;
    position: relative;
    font-size: 14.8px;
    color: var(--portal-muted);
}

.portal-steps li::before {
    content: counter(portal-step);
    position: absolute;
    top: 0;
    left: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--portal-surface-alt);
    color: var(--portal-primary);
    border: 1px solid var(--portal-border-strong);
    font-size: 15px;
    font-weight: 700;
}

.portal-steps b {
    display: block;
    margin-bottom: 3px;
    font-size: 15.5px;
    font-weight: 600;
    color: var(--portal-text);
}

/* ---------- Footer ------------------------------------------------------ */

.portal-footer {
    background: var(--portal-primary-deep);
    color: rgba(255, 255, 255, .74);
    padding-block: 34px;
    font-size: 14px;
}

.portal-footer__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 28px;
    align-items: center;
    justify-content: space-between;
}

.portal-footer strong {
    display: block;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
}

/* ---------- Motion ------------------------------------------------------ */

.portal-reveal {
    opacity: 0;
    transform: translateY(16px);
    animation: portal-rise .6s cubic-bezier(.22, .61, .36, 1) forwards;
}

.portal-reveal:nth-child(2) { animation-delay: .09s; }
.portal-reveal:nth-child(3) { animation-delay: .18s; }

@keyframes portal-rise {
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }

    .portal-reveal { opacity: 1; transform: none; }
    .portal-card--open:hover { transform: none; }
}

/* ---------- Responsive -------------------------------------------------- */

@media (max-width: 1080px) {
    .portal-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .portal-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
    .portal-container { padding-inline: 24px; }
    .portal-header__inner { min-height: 72px; }
    .portal-brand__name { font-size: 14.5px; }
    .portal-brand__sub { font-size: 12px; }
    .portal-hero__inner { padding-block: 46px 52px; }
    .portal-section { padding-block: 48px; }
    .portal-panel { padding: 30px 24px; }
}

@media (max-width: 720px) {
    .portal-cards { grid-template-columns: minmax(0, 1fr); }
    .portal-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
    .portal-steps { grid-template-columns: minmax(0, 1fr); gap: 22px; }
}

@media (max-width: 560px) {
    .portal-container { padding-inline: 18px; }
    .portal-header__inner { flex-wrap: wrap; gap: 12px; }
    .portal-brand { flex: 1 1 100%; }
    .portal-header__actions { flex: 1 1 100%; }
    .portal-header__actions .portal-btn { width: 100%; }
    .portal-brand__mark,
    .portal-brand__logo { width: 44px; height: 44px; font-size: 15px; }
    .portal-card { padding: 34px 22px 26px; }
    .portal-card__icon { width: 90px; height: 90px; font-size: 38px; }
    .portal-card__title { font-size: 21px; }
    .portal-footer__inner { flex-direction: column; align-items: flex-start; }
}

/* ---- Official emblem -------------------------------------------------- */
/* The crest is a detailed circular seal, so it is given room to breathe and
   never cropped into a smaller circular frame. */

.portal-brand__logo { width: 58px; height: 58px; object-fit: contain; }

.cas-top__logo {
    width: 42px; height: 42px; flex: none; object-fit: contain;
    background: #fff; border-radius: 50%; padding: 3px;
}

.cofc-brand__logo {
    width: 42px; height: 42px; flex: none; object-fit: contain;
    background: #fff; border-radius: 50%; padding: 3px;
}

.cas-auth__mark img { width: 100%; height: 100%; object-fit: contain; }
.cas-auth__mark { background: #fff; padding: 5px; border-color: rgba(255,255,255,.5); }

@media (max-width: 560px) {
    .portal-brand__logo { width: 46px; height: 46px; }
}
