html {
    height: 100%;
}

/* Kurumsal ton: #4C7FB0 (logo ile uyumlu) */
.login-page {
    --corp: #4C7FB0;
    --corp-dark: #3a6288;
    --corp-deep: #2e4d6e;
    --corp-light: #6a94bd;
    --corp-mist: #a8c5de;
    --corp-pale: #d4e4f0;
    --ring: rgba(76, 127, 176, 0.35);
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    height: 100dvh;
    font-family: var(--font-main, 'Inter', system-ui, sans-serif);
    font-size: 1rem;
    line-height: 1.45;
    color: var(--text-main, #1e293b);
    overflow-x: clip;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: linear-gradient(
        165deg,
        var(--corp-deep) 0%,
        var(--corp-dark) 28%,
        var(--corp) 52%,
        var(--corp-light) 78%,
        var(--corp-mist) 100%
    );
    background-attachment: fixed;
}

.login-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='96' height='96' viewBox='0 0 96 96' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='2' cy='2' r='1' fill='%23ffffff' fill-opacity='0.12'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

/* Masaüstü: marka + panel ortada, yan yana, birbirine yakın; dikey ortalı */
.login-shell {
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    width: 100%;
    min-height: 100dvh;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    height: 100%;
    max-height: 100dvh;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    padding: max(1.25rem, env(safe-area-inset-top))
             max(1.25rem, env(safe-area-inset-right))
             max(1.25rem, env(safe-area-inset-bottom))
             max(1.25rem, env(safe-area-inset-left));
    gap: clamp(0.75rem, 1.4vw, 1.35rem);
}

.login-brand {
    width: 100%;
    max-width: 26rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
}

.login-brand-inner {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

.logo-stage {
    margin: 0 auto 1.1rem;
    width: min(74vw, 19.5rem);
    aspect-ratio: 1;
    max-height: min(52vh, 19.5rem);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 1.35rem;
   
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}

.logo-stage img {
    width: 78%;
    height: 78%;
    max-width: 270px;
    max-height: 270px;
    object-fit: contain;
    filter: drop-shadow(0 12px 28px rgba(15, 23, 42, 0.45));
}

.brand-accent-bar {
    width: 3.5rem;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.95), var(--corp-pale));
    margin: 0 auto 0.6rem;
}

/* Masaüstü logo/çizgi: temel .logo-stage kurallarından sonra (cascade) */
@media (min-width: 901px) {
    .login-brand .logo-stage {
        width: min(37.5rem, 46vw);
        aspect-ratio: 6 / 5;
        height: auto;
        max-height: min(31.25rem, 52vh);
        margin-bottom: 0;
        border-radius: 1.5rem;
    }

    .login-brand .logo-stage img {
        width: auto;
        height: auto;
        max-width: 100%;
        max-height: min(25rem, 52vh);
    }

   

    .login-brand .brand-accent-bar {
        width: 2.75rem;
        height: 1px;
        margin: 0 auto 0.75rem;
        border-radius: 0;
        background: rgba(255, 255, 255, 0.55);
        box-shadow: none;
    }
}

@media (min-width: 901px) and (max-width: 1180px) {
    .login-brand .logo-stage {
        width: min(30rem, 44vw);
        max-height: min(25rem, 48vh);
    }

    .login-brand .logo-stage img {
        max-height: min(20rem, 36vh);
    }

    .login-brand .brand-copy {
        margin-top: 2rem;
    }
}

.login-brand h1 {
    font-weight: 700;
    font-size: clamp(1.5rem, 3.6vw, 2rem);
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin: 0 0 0.25rem;
    text-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}

.login-brand .blurb {
    font-size: 0.875rem;
    line-height: 1.6;
    margin: 0.9rem 0 0;
    color: rgba(255, 255, 255, 0.72);
    max-width: 21rem;
    min-height: 3.2em; /* Prevent layout shift */
}

.typewriter-cursor {
    width: 2px;
    background-color: rgba(255, 255, 255, 0.75);
    animation: blink-caret 0.75s step-end infinite;
    margin-left: 2px;
    display: inline-block;
    vertical-align: middle;
    height: 1.2em;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes blink-caret {
    from, to { opacity: 0 }
    50% { opacity: 1 }
}

.login-panel {
    width: 100%;
    max-width: 24rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-panel-card {
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 1.125rem;
    padding: clamp(1.5rem, 3.5vw, 2.35rem);
    border: 1px solid rgba(76, 127, 176, 0.35);
    box-shadow:
        0 4px 28px rgba(46, 77, 110, 0.1),
        0 0 0 1px rgba(76, 127, 176, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.form-kicker {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--corp-dark);
    margin-bottom: 0.3rem;
}

.form-title {
    font-weight: 700;
    font-size: clamp(1.3rem, 3vw, 1.45rem);
    color: var(--text-main, #1e293b);
    letter-spacing: -0.02em;
    margin: 0 0 0.3rem;
}

.form-subtitle {
    color: var(--text-muted, #64748b);
    font-size: 0.875rem;
    margin: 0 0 1.25rem;
}

.field {
    margin-bottom: 0.85rem;
}

.input-wrap {
    display: flex;
    align-items: stretch;
    min-height: 46px;
    border: 2px solid var(--border-color, #e2e8f0);
    border-radius: 0.7rem;
    background: #f8fafc;
    transition: background-color 0.15s ease;
    overflow: hidden;
}

.input-wrap:focus-within {
    border-color: var(--corp);
    box-shadow: 0 0 0 3px var(--ring);
    background: #fff;
}

.input-affix {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 46px;
    color: var(--text-muted, #64748b);
    background: #f1f5f9;
    border: none;
}

.input-affix.is-action {
    cursor: pointer;
}

.input-affix.is-action:hover {
    color: var(--corp-dark);
    background: rgba(76, 127, 176, 0.08);
}

.input-affix svg {
    width: 19px;
    height: 19px;
}

.login-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font: inherit;
    font-size: 0.9375rem;
    padding: 0 0.75rem;
    color: var(--text-main, #1e293b);
    outline: none;
}

.login-input::placeholder {
    color: #94a3b8;
}

.btn-login {
    width: 100%;
    min-height: 48px;
    border: none;
    border-radius: 0.7rem;
    padding: 0.65rem 1rem;
    font: inherit;
    font-weight: 600;
    font-size: 0.9375rem;
    color: #fff;
    background: linear-gradient(180deg, var(--corp-light) 0%, var(--corp) 42%, var(--corp-dark) 100%);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    box-shadow: 0 8px 22px -5px rgba(46, 77, 110, 0.45);
    transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

.btn-login:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px -6px rgba(46, 77, 110, 0.42);
}

.btn-login:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.btn-login svg {
    width: 18px;
    height: 18px;
}

.session-hint {
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
    line-height: 1.4;
    text-align: center;
    margin: 0 0 0.65rem;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0.35rem;
}

.session-hint svg {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    margin-top: 0.1rem;
    color: var(--corp-dark);
}

.session-hint-long { display: inline; }
.session-hint-short { display: none; }

.footer-text {
    text-align: center;
    margin-top: 0.85rem;
    color: var(--text-muted, #64748b);
    font-size: 0.6875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

.footer-text svg {
    width: 12px;
    height: 12px;
}

/* Masaüstü: kurallar temel stillerden sonra + .login-shell ile özgüllük (cascade) */
@media (min-width: 901px) {
    .login-shell {
        padding: max(0.75rem, env(safe-area-inset-top))
                 max(1rem, env(safe-area-inset-right))
                 max(0.75rem, env(safe-area-inset-bottom))
                 max(1rem, env(safe-area-inset-left));
        gap: clamp(0.65rem, 1.1vw, 1.1rem);
    }

    .login-shell .login-brand {
        flex: 0 1 auto;
        max-width: 40rem;
    }

    .login-shell .login-panel {
        flex: 0 1 auto;
        max-width: 27.5rem;
        min-width: 0;
    }

    .login-shell .login-brand h1 {
        font-size: clamp(1.85rem, 2.4vw, 2.35rem);
    }

    .login-shell .login-brand .blurb {
        max-width: 28rem;
        font-size: 0.9375rem;
    }

    .login-shell .login-panel-card {
        padding: 1.65rem 1.85rem 1.5rem;
        border-radius: 1.2rem;
    }

    .login-shell .form-title {
        font-size: clamp(1.45rem, 2vw, 1.65rem);
    }

    .login-shell .form-subtitle {
        margin-bottom: 1.05rem;
        font-size: 0.9375rem;
    }

    .login-shell .field {
        margin-bottom: 0.75rem;
    }

    .login-shell .input-wrap {
        min-height: 50px;
        border-radius: 0.75rem;
    }

    .login-shell .input-affix {
        width: 50px;
    }

    .login-shell .login-input {
        font-size: 1rem;
    }

    .login-shell .btn-login {
        min-height: 52px;
        font-size: 1rem;
    }

    .login-shell .session-hint {
        margin-bottom: 0.55rem;
    }

    .login-shell .footer-text {
        margin-top: 0.75rem;
    }
}

@media (min-width: 901px) and (max-width: 1180px) {
    .login-shell {
        gap: clamp(0.5rem, 1vw, 0.85rem);
    }

    .login-shell .login-brand {
        max-width: min(36rem, 52vw);
    }

    .login-shell .login-panel {
        max-width: min(25rem, 40vw);
    }
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mobil: büyük ortada logo, form tam genişlik, blok ortada */
@media (max-width: 900px) {
    html {
        scroll-padding-bottom: min(42vh, 280px);
    }

    .login-page {
        height: auto;
        min-height: 100dvh;
        scroll-padding-bottom: min(42vh, 280px);
    }

    .login-shell {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: center;
        min-height: 100dvh;
        min-height: 100vh;
        height: auto;
        max-height: none;
        gap: 1.1rem;
        padding: max(0.75rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
    }

    .login-brand {
        max-width: none;
        width: 100%;
        flex-shrink: 0;
    }

    .login-brand-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 0;
    }

    .logo-stage {
        width: min(58vw, 14rem);
        height: min(58vw, 14rem);
        max-width: 14rem;
        max-height: 14rem;
        margin: 0 auto 0.85rem;
    }

    .logo-stage img {
        width: 80%;
        height: 80%;
        max-width: 11rem;
        max-height: 11rem;
    }

    .login-page .hidden-sm {
        display: none !important;
    }

    .brand-copy {
        align-items: center;
        text-align: center;
        width: 100%;
    }

    .login-brand h1 {
        font-size: clamp(1.35rem, 5.5vw, 1.65rem);
        margin: 0 0 0.2rem;
    }

    .login-brand .blurb {
        display: none !important;
    }

    .login-panel {
        width: 100%;
        max-width: none;
        flex: 0 1 auto;
        display: flex;
        justify-content: center;
        align-items: stretch;
        padding: 0;
    }

    .login-panel-card {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 1.15rem 1.15rem 1.05rem;
        border-radius: 1rem;
    }

    .form-kicker,
    .form-title,
    .form-subtitle {
        text-align: center;
    }

    .form-subtitle {
        font-size: 0.8125rem;
        margin-bottom: 1rem;
    }

    .field {
        margin-bottom: 0.65rem;
    }

    .input-wrap {
        min-height: 48px;
        border-radius: 0.65rem;
    }

    .input-affix {
        width: 48px;
    }

    .login-input {
        font-size: 16px;
    }

    .session-hint {
        font-size: 0.6875rem;
        margin-bottom: 0.55rem;
    }

    .session-hint-long {
        display: none;
    }

    .session-hint-short {
        display: inline;
    }

    .footer-text {
        margin-top: 0.6rem;
        font-size: 0.625rem;
    }
}

/* Çok alçak ekran (yatay telefon) */
@media (max-width: 900px) and (max-height: 500px) {
    .login-shell {
        justify-content: flex-start;
        padding-top: 0.5rem;
    }

    .logo-stage {
        width: 4.5rem;
        height: 4.5rem;
        margin-bottom: 0.4rem;
    }

    .logo-stage img {
        max-width: 3.25rem;
        max-height: 3.25rem;
    }

    .login-brand .blurb {
        display: none;
    }

    .form-subtitle {
        display: none;
    }

    .session-hint {
        display: none;
    }

    .login-panel-card {
        padding: 0.85rem 1rem;
    }
}
