/* =========================================================
   DL Dokan — Login (modern redesign)
   ========================================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }
body.dd-auth { min-height: 100vh; }

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

/* left brand panel */
.auth-aside {
    position: relative;
    overflow: hidden;
    display: flex; flex-direction: column; justify-content: space-between;
    padding: 40px 48px;
    background:
        radial-gradient(700px 400px at 0% 0%, rgba(138,121,255,.32), transparent 60%),
        radial-gradient(600px 400px at 100% 100%, rgba(57,198,242,.18), transparent 60%),
        #0B1020;
    border-right: 1px solid rgba(140,158,214,.12);
}
.auth-aside::before {
    content: ''; position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(140,158,214,.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(140,158,214,.07) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 70%);
    mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 70%);
    pointer-events: none;
}
.auth-aside > * { position: relative; }
.auth-brand { display: inline-flex; align-items: center; gap: 12px; color: #E9EDF7; text-decoration: none; font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; }
.auth-brand i {
    width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #8A79FF 0%, #5C8BFF 55%, #39C6F2 100%); color: #fff;
    box-shadow: 0 12px 28px -10px rgba(110,108,255,.8);
}
.auth-pitch h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.1; color: #F2F5FC; max-width: 460px; }
.auth-pitch p { color: #A9B2CC; margin: 14px 0 26px; max-width: 420px; font-size: 1.02rem; line-height: 1.6; }
.auth-pitch ul { list-style: none; display: grid; gap: 12px; }
.auth-pitch li { display: flex; align-items: center; gap: 12px; color: #C3CAE0; font-weight: 600; font-size: .95rem; }
.auth-pitch li i {
    width: 32px; height: 32px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
    background: rgba(200,245,66,.1); border: 1px solid rgba(200,245,66,.25); color: #C8F542; font-size: .85rem;
}
.auth-foot { color: #5E6886; font-size: .85rem; }

/* right form panel */
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-container { width: 100%; max-width: 400px; }
.login-header { margin-bottom: 28px; }
.login-header i {
    display: none;
    width: 46px; height: 46px; border-radius: 14px; align-items: center; justify-content: center; margin-bottom: 18px;
    background: linear-gradient(135deg, #8A79FF 0%, #5C8BFF 55%, #39C6F2 100%); color: #fff; font-size: 1.2rem;
    box-shadow: 0 12px 28px -10px rgba(110,108,255,.8);
}
.login-header .dd-logo-mark { display: none; margin-bottom: 18px; }
.login-header h1 { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.035em; color: #F2F5FC; }
.login-header p { color: #8E98B5; margin-top: 6px; }

.login-form { display: flex; flex-direction: column; }
.field-label { font-size: .84rem; font-weight: 700; color: #C3CAE0; margin-bottom: 8px; }
.form-group { position: relative; margin-bottom: 18px; }
.form-group > i:first-child {
    position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
    color: #5E6886; font-size: .9rem; pointer-events: none; transition: color .2s ease;
}
.form-control {
    width: 100%; height: 50px;
    padding: 0 46px 0 42px;
    border-radius: 13px;
    background: #0A0F1C;
    border: 1px solid rgba(140,158,214,.22);
    color: #E9EDF7;
    font-size: .95rem;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.form-control::placeholder { color: #5E6886; }
.form-control:focus { outline: none; border-color: rgba(138,121,255,.75); box-shadow: 0 0 0 4px rgba(123,107,255,.16); background: #0C1222; }
.form-group:focus-within > i:first-child { color: #B9AEFF; }
.form-group .toggle-password {
    position: absolute; right: 8px; left: auto; top: 50%; transform: translateY(-50%);
    width: 34px; height: 34px; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    color: #8E98B5; cursor: pointer; z-index: 2; transition: background .2s ease, color .2s ease;
}
.form-group .toggle-password:hover { background: rgba(140,158,214,.1); color: #E9EDF7; }

/* remember me */
.remember-me { margin: 2px 0 22px; }
.checkbox-container { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: #A9B2CC; font-size: .9rem; font-weight: 600; user-select: none; }
.checkbox-container input { position: absolute; opacity: 0; width: 0; height: 0; }
.checkmark {
    width: 20px; height: 20px; border-radius: 6px;
    background: #0A0F1C; border: 1px solid rgba(140,158,214,.3);
    display: inline-flex; align-items: center; justify-content: center;
    transition: all .2s ease;
}
.checkmark::after { content: ''; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px,-1px); opacity: 0; }
.checkbox-container input:checked + .checkmark { background: linear-gradient(135deg, #8A79FF, #5C8BFF); border-color: transparent; }
.checkbox-container input:checked + .checkmark::after { opacity: 1; }
.checkbox-container input:focus-visible + .checkmark { box-shadow: 0 0 0 3px rgba(123,107,255,.35); }

/* buttons */
.submit-btn {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 50px;
    border: 0; border-radius: 13px;
    background: linear-gradient(135deg, #8A79FF 0%, #5C8BFF 55%, #39C6F2 100%);
    color: #fff; font-size: 1rem; font-weight: 700; text-decoration: none; cursor: pointer;
    box-shadow: 0 16px 34px -14px rgba(110,108,255,.85), inset 0 1px 0 rgba(255,255,255,.22);
    transition: transform .2s ease, filter .2s ease;
}
.submit-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.submit-btn .btn-text { transition: opacity .2s ease; }
.submit-btn.register-btn, .register-btn {
    display: flex; margin-top: 0; padding: 0;
    background: rgba(140,158,214,.07);
    border: 1px solid rgba(140,158,214,.22);
    color: #E9EDF7;
    box-shadow: none;
}
.submit-btn.register-btn:hover { background: rgba(140,158,214,.13); filter: none; }

.auth-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0; color: #5E6886; font-size: .8rem; font-weight: 600; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: rgba(140,158,214,.15); }

.loading {
    display: none;
    position: absolute;
    width: 20px; height: 20px;
    border: 3px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%;
    animation: dd-spin .8s linear infinite;
}
@keyframes dd-spin { to { transform: rotate(360deg); } }

/* error */
.error-message {
    display: none;
    align-items: flex-start; gap: 10px;
    padding: 12px 14px; margin-bottom: 20px;
    border-radius: 12px;
    background: rgba(255,93,125,.1);
    border: 1px solid rgba(255,93,125,.32);
    color: #FFC2CE; font-size: .9rem; font-weight: 600; line-height: 1.5;
    word-break: break-word;
}
.error-message i { color: #FF5D7D; margin-top: 3px; flex-shrink: 0; }
.error-message.show { display: flex; animation: dd-shake .45s ease-in-out; }
.error-message .telegram-link { color: #C8F542; font-weight: 700; text-decoration: none; display: inline; }
.error-message .telegram-link:hover { text-decoration: underline; }
@keyframes dd-shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

@media (max-width: 900px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .login-header i { display: inline-flex; }
    .login-header .dd-logo-mark { display: block; }
    .auth-main { padding: 32px 18px; min-height: 100vh; }
}
