@import url('https://fonts.bunny.net/css?family=plus-jakarta-sans:400,500,600,700,800');

/* ═══════════════════════════════════════════════════════
   ITM Webmail — Giriş (modern · v3)
   ═══════════════════════════════════════════════════════ */

html.itm-light {
    --auth-bg: #f0f4fa;
    --auth-orb-1: rgba(37, 99, 235, 0.18);
    --auth-orb-2: rgba(99, 102, 241, 0.14);
    --auth-orb-3: rgba(26, 31, 54, 0.08);
    --auth-grid: rgba(37, 99, 235, 0.04);
    --auth-panel-bg: rgba(255, 255, 255, 0.82);
    --auth-panel-border: rgba(255, 255, 255, 0.9);
    --auth-panel-shadow: 0 32px 80px -24px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(226, 232, 240, 0.7);
    --auth-brand-bg: linear-gradient(145deg, #1a1f36 0%, #243056 48%, #1e3a6e 100%);
    --auth-brand-text: #ffffff;
    --auth-brand-muted: rgba(255, 255, 255, 0.72);
    --auth-login-bg: transparent;
    --auth-text: #0f172a;
    --auth-text-2: #64748b;
    --auth-muted: #94a3b8;
    --auth-border: #e2e8f0;
    --auth-input-bg: #f8fafc;
    --auth-input-border: #e2e8f0;
    --auth-focus: #2563eb;
    --auth-focus-ring: rgba(37, 99, 235, 0.16);
    --auth-btn: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #1d4ed8 100%);
    --auth-btn-shadow: 0 10px 28px -8px rgba(37, 99, 235, 0.55);
    --auth-toggle-bg: rgba(255, 255, 255, 0.85);
    --auth-toggle-color: #64748b;
    --auth-mark-bg: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    --auth-mark-color: #2563eb;
}

html.itm-dark,
html.dark-mode.itm-dark {
    --auth-bg: #060a12;
    --auth-orb-1: rgba(59, 130, 246, 0.22);
    --auth-orb-2: rgba(99, 102, 241, 0.16);
    --auth-orb-3: rgba(15, 23, 42, 0.5);
    --auth-grid: rgba(59, 130, 246, 0.06);
    --auth-panel-bg: rgba(18, 24, 38, 0.88);
    --auth-panel-border: rgba(255, 255, 255, 0.06);
    --auth-panel-shadow: 0 32px 80px -24px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.05);
    --auth-brand-bg: linear-gradient(145deg, #0c101a 0%, #151c2e 50%, #1a2744 100%);
    --auth-brand-text: #f1f5f9;
    --auth-brand-muted: rgba(203, 213, 225, 0.72);
    --auth-login-bg: transparent;
    --auth-text: #f1f5f9;
    --auth-text-2: #94a3b8;
    --auth-muted: #64748b;
    --auth-border: #2a3145;
    --auth-input-bg: #121826;
    --auth-input-border: #334155;
    --auth-focus: #60a5fa;
    --auth-focus-ring: rgba(96, 165, 250, 0.2);
    --auth-btn: linear-gradient(135deg, #60a5fa 0%, #3b82f6 50%, #2563eb 100%);
    --auth-btn-shadow: 0 10px 28px -8px rgba(59, 130, 246, 0.45);
    --auth-toggle-bg: rgba(22, 27, 40, 0.9);
    --auth-toggle-color: #cbd5e1;
    --auth-mark-bg: linear-gradient(135deg, rgba(37, 99, 235, 0.2) 0%, rgba(59, 130, 246, 0.1) 100%);
    --auth-mark-color: #60a5fa;
}

/* ── Reset elastic ── */
html body.task-login {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif !important;
}

html body.task-login #layout {
    min-height: 100vh !important;
    background: var(--auth-bg) !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    overflow-x: hidden !important;
}

html body.task-login #layout-content.itm-auth {
    position: relative;
    min-height: 100vh !important;
    height: auto !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    text-align: left !important;
    display: block !important;
}

html body.task-login #layout-content .propform {
    overflow: visible !important;
    padding: 0 !important;
    height: auto !important;
}

html body.task-login .voice,
html body.task-login #logo {
    display: none !important;
}

/* ── Animated background ── */
.itm-auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: var(--auth-bg);
    overflow: hidden;
}

.itm-auth-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
    animation: itm-auth-float 18s ease-in-out infinite;
}

.itm-auth-orb-1 {
    width: 420px;
    height: 420px;
    background: var(--auth-orb-1);
    top: -8%;
    left: -6%;
}

.itm-auth-orb-2 {
    width: 360px;
    height: 360px;
    background: var(--auth-orb-2);
    bottom: -10%;
    right: -4%;
    animation-delay: -6s;
}

.itm-auth-orb-3 {
    width: 280px;
    height: 280px;
    background: var(--auth-orb-3);
    top: 42%;
    left: 38%;
    animation-delay: -12s;
}

.itm-auth-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--auth-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--auth-grid) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 20%, transparent 100%);
}

@keyframes itm-auth-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(24px, -18px) scale(1.04); }
    66% { transform: translate(-16px, 12px) scale(0.96); }
}

/* ── Theme toggle ── */
.itm-theme-toggle {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 100;
    width: 42px;
    height: 42px;
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    background: var(--auth-toggle-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--auth-toggle-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.itm-theme-toggle:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.itm-theme-toggle svg { width: 18px; height: 18px; }

html.itm-light .itm-icon-moon,
html.itm-dark .itm-icon-sun,
html.dark-mode .itm-icon-sun { display: none; }

html.itm-light .itm-icon-sun,
html.itm-dark .itm-icon-moon,
html.dark-mode .itm-icon-moon { display: block; }

/* ── Shell ── */
.itm-auth-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 1.25rem 2rem;
    gap: 1.25rem;
}

/* ── Glass panel ── */
.itm-auth-panel {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 440px;
    background: var(--auth-panel-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--auth-panel-border);
    border-radius: 24px;
    box-shadow: var(--auth-panel-shadow);
    overflow: visible;
    animation: itm-auth-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes itm-auth-in {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (min-width: 900px) {
    .itm-auth-panel {
        grid-template-columns: 1.05fr 1fr;
        max-width: 920px;
        align-items: start;
    }
}

/* ── Brand panel ── */
.itm-auth-brand {
    display: none;
    position: relative;
    overflow: hidden;
    background: var(--auth-brand-bg);
    color: var(--auth-brand-text);
}

@media (min-width: 900px) {
    .itm-auth-brand {
        display: flex;
        align-items: center;
    }
}

.itm-brand-inner {
    position: relative;
    z-index: 2;
    padding: 2.75rem 2.5rem;
}

.itm-brand-glow {
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.35) 0%, transparent 70%);
    top: -80px;
    right: -60px;
    pointer-events: none;
}

.itm-brand-logo {
    height: 34px;
    width: auto;
    margin-bottom: 1.5rem;
    filter: brightness(0) invert(1);
}

.itm-brand-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    backdrop-filter: blur(8px);
}

.itm-brand-title {
    margin: 1.1rem 0 0;
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.22;
    letter-spacing: -0.035em;
}

.itm-brand-desc {
    margin: 0.85rem 0 0;
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--auth-brand-muted);
    max-width: 30ch;
}

.itm-brand-features {
    margin: 2rem 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.itm-brand-features li {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    font-size: 0.84rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.92);
    transition: background 0.2s;
}

.itm-brand-features li:hover {
    background: rgba(255, 255, 255, 0.1);
}

.itm-brand-feature-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.25);
    color: #93c5fd;
}

.itm-brand-feature-icon svg {
    width: 18px;
    height: 18px;
}

/* ── Login section ── */
.itm-auth-login {
    padding: 2rem 2rem 2rem;
    background: var(--auth-login-bg);
    align-self: start;
    height: auto !important;
    min-height: 0 !important;
}

@media (min-width: 900px) {
    .itm-auth-login {
        padding: 2.5rem 2.75rem 2.5rem;
    }
}

.itm-login-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    height: auto !important;
    min-height: 0 !important;
}

/* Form kutusu yükseklik oluşturmasın — alanlar başlığın hemen altında */
html body.task-login #login-form.itm-form,
html body.task-login #login-form.propform {
    display: contents !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    text-align: left !important;
}

html body.task-login #login-form input[type="hidden"] {
    display: none !important;
}

.itm-login-fields {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    margin: 0;
    padding: 0;
    order: 2;
}

.itm-login-actions {
    margin: 0.5rem 0 0;
    order: 3;
}

.itm-login-head {
    order: 1;
    text-align: center;
    margin: 0;
    flex-shrink: 0;
}

@media (min-width: 900px) {
    .itm-login-head {
        text-align: left;
    }
}

.itm-login-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-bottom: 0.65rem;
    border-radius: 12px;
    background: var(--auth-mark-bg);
    color: var(--auth-mark-color);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
}

.itm-login-mark svg {
    width: 26px;
    height: 26px;
}

.itm-login-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--auth-text);
}

.itm-login-sub {
    margin: 0.35rem 0 0;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--auth-text-2);
}

/* ── Form (div tabanlı — JS rebuild) ── */
html body.task-login #login-form:not([data-itm-rebuilt]) table {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

html body.task-login #login-form:not([data-itm-rebuilt]) tbody,
html body.task-login #login-form:not([data-itm-rebuilt]) tr,
html body.task-login #login-form:not([data-itm-rebuilt]) td {
    display: block !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

html body.task-login #login-form:not([data-itm-rebuilt]) tr {
    margin-bottom: 0.75rem !important;
}

html body.task-login #login-form:not([data-itm-rebuilt]) td.title {
    padding-bottom: 0.3rem !important;
}

html body.task-login #login-form:not([data-itm-rebuilt]) p.formbuttons {
    margin: 0.5rem 0 0 !important;
    padding: 0 !important;
}

.itm-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
}

.itm-field label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--auth-text-2);
}

.itm-field-user,
.itm-field-pass {
    position: relative;
}

.itm-field-user::after,
.itm-field-pass::after {
    content: '';
    position: absolute;
    left: 14px;
    bottom: 16px;
    width: 18px;
    height: 18px;
    opacity: 0.45;
    pointer-events: none;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.itm-field-user::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M4 4h16v16H4z'/%3E%3Cpath d='M4 8l8 5 8-5'/%3E%3C/svg%3E");
}

.itm-field-pass::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E");
}

html body.task-login #login-form input.form-control,
html body.task-login #login-form input[type="text"],
html body.task-login #login-form input[type="password"] {
    display: block;
    width: 100% !important;
    height: 48px !important;
    padding: 0 1rem 0 2.75rem !important;
    margin: 0 !important;
    font-size: 0.94rem !important;
    font-family: inherit;
    font-weight: 500;
    color: var(--auth-text) !important;
    background: var(--auth-input-bg) !important;
    border: 1.5px solid var(--auth-input-border) !important;
    border-radius: 12px !important;
    box-shadow: none !important;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
}

/* Eski tablo yapısı (JS yüklenmezse) */
html body.task-login #login-form table {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

html body.task-login #login-form tbody,
html body.task-login #login-form tr,
html body.task-login #login-form td {
    display: block !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

html body.task-login #login-form input::placeholder {
    color: var(--auth-muted);
    font-weight: 400;
}

html body.task-login #login-form input:focus {
    border-color: var(--auth-focus) !important;
    box-shadow: 0 0 0 4px var(--auth-focus-ring) !important;
    outline: none !important;
    background: var(--auth-panel-bg) !important;
}

html body.task-login #login-form p.formbuttons,
html body.task-login #login-form .itm-login-actions {
    margin: 0.5rem 0 0 !important;
    padding: 0 !important;
    text-align: left !important;
}

html body.task-login #login-form .button.mainaction,
html body.task-login #login-form button.submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    height: 50px !important;
    margin: 0 !important;
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    font-family: inherit;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff !important;
    background: var(--auth-btn) !important;
    border: none !important;
    border-radius: 14px !important;
    cursor: pointer;
    box-shadow: var(--auth-btn-shadow) !important;
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}

html body.task-login #login-form .button.mainaction:hover,
html body.task-login #login-form button.submit:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
    box-shadow: 0 14px 32px -8px rgba(37, 99, 235, 0.6) !important;
}

html body.task-login #login-form .button.mainaction:active,
html body.task-login #login-form button.submit:active {
    transform: translateY(0);
}

/* ── Footer ── */
.itm-login-foot {
    margin-top: 1.15rem;
    padding-top: 1rem;
    border-top: 1px solid var(--auth-border);
    text-align: center;
}

.itm-login-foot:empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

@media (min-width: 900px) {
    .itm-login-foot {
        text-align: left;
    }
}

.itm-support-link {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--auth-text-2) !important;
    text-decoration: none !important;
    transition: color 0.15s;
}

.itm-support-link:hover {
    color: var(--auth-focus) !important;
}

.itm-auth-copy {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--auth-muted);
    letter-spacing: 0.02em;
}

@media (max-width: 899px) {
    .itm-auth-shell {
        padding: 4.5rem 1rem 1.5rem;
        align-items: stretch;
    }

    .itm-auth-panel {
        border-radius: 20px;
        max-width: 400px;
    }

    .itm-auth-login {
        padding: 1.35rem 1.35rem 1.5rem;
    }

    .itm-login-stack {
        gap: 0.4rem;
    }

    .itm-login-mark {
        width: 40px;
        height: 40px;
        margin-bottom: 0.45rem;
    }

    .itm-login-title {
        font-size: 1.35rem;
    }

    .itm-login-sub {
        margin-top: 0.2rem;
    }

    .itm-login-foot {
        margin-top: 0.85rem;
        padding-top: 0.85rem;
    }
}

/* Bildirimler */
html body.task-login #messagestack {
    position: fixed !important;
    top: 16px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    max-width: min(400px, calc(100vw - 32px)) !important;
    z-index: 99999 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

html body.task-login #messagestack div {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 12px 16px !important;
    border-radius: 14px !important;
    border: 1px solid rgba(239, 68, 68, 0.35) !important;
    background: var(--auth-panel-bg) !important;
    backdrop-filter: blur(12px);
    color: #b91c1c !important;
    font-size: 0.84rem !important;
    font-weight: 500 !important;
    box-shadow: var(--auth-panel-shadow) !important;
}

html.itm-dark body.task-login #messagestack div {
    color: #fca5a5 !important;
}

html body.task-login #messagestack div i.icon {
    width: 30px !important;
    height: 30px !important;
    border-radius: 8px !important;
    background: rgba(239, 68, 68, 0.12) !important;
}
