@font-face {
    font-family: "Vazirmatn";
    src: url("/static/fonts/Vazirmatn-Bold.ttf") format("truetype");
    font-weight: 700;
    font-display: swap
}

@font-face {
    font-family: "Vazirmatn";
    src: url("/static/fonts/Vazirmatn-Regular.ttf") format("truetype");
    font-weight: 400;
    font-display: swap
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent
}

:root {
    --bg: #0B141A;
    --card-bg: #111B21;
    --surface: #1F2C34;
    --input-bg: #233138;
    --input-focus: #2A3942;
    --accent: #25D366;
    --accent-hover: #1EBE57;
    --accent-dark: #075E54;
    --accent-glow: rgba(37, 211, 102, 0.18);
    --text: #E9EDEF;
    --subtext: #8696A0;
    --border: #2A3942;
    --error: #EA4335;
    --radius: 16px;
    --ease: cubic-bezier(0.4, 0, 0.2, 1)
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden
}

body {
    font-family: "Vazirmatn", Tahoma, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    background-image: radial-gradient(circle at 50% 0%, rgba(37, 211, 102, 0.03) 0%, transparent 50%);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    -webkit-font-smoothing: antialiased
}

.app {
    width: 100%;
    max-width: 420px;
    background-color: var(--card-bg);
    border-radius: 24px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.03);
    padding: 48px 36px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: cardEntry 0.6s var(--ease) forwards
}

.app::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-dark), var(--accent), var(--accent-dark));
    z-index: 10
}

@keyframes cardEntry {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98)
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1)
    }
}

.form-scroll {
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none
}

.form-scroll::-webkit-scrollbar {
    width: 0;
    display: none
}

.form-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center
}

.logo-area {
    text-align: center;
    margin-bottom: 36px;
    width: 100%
}

.logo-wrap {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    position: relative
}

.logo-glow {
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    animation: glowPulse 3s ease-in-out infinite
}

.logo-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    position: relative;
    z-index: 1;
    overflow: hidden;
    border: 3px solid var(--accent);
    background: linear-gradient(135deg, var(--accent-dark) 0%, var(--accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 44px;
    color: #fff;
    box-shadow: 0 8px 24px var(--accent-glow)
}

.logo-circle i {
    position: relative;
    z-index: 1
}

.app-title {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text)
}

.app-subtitle {
    font-size: 14px;
    color: var(--subtext);
    margin-top: 8px;
    font-weight: 400
}

.form-header {
    text-align: center;
    margin-bottom: 32px;
    width: 100%
}

.form-icon-wrap {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-dark) 0%, var(--accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px var(--accent-glow);
    font-size: 26px;
    color: #fff
}

.form-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text)
}

.form-desc {
    font-size: 14px;
    color: var(--subtext);
    margin-top: 6px
}

.input-field {
    position: relative;
    margin-bottom: 20px;
    width: 100%
}

.input-field input {
    width: 100%;
    padding: 24px 16px 10px;
    background: var(--input-bg);
    border: 1.5px solid transparent;
    border-radius: 12px;
    color: var(--text);
    font-size: 16px;
    font-family: inherit;
    transition: all 0.2s var(--ease);
    direction: ltr;
    text-align: left;
    outline: none
}

.input-field input:focus {
    border-color: var(--accent);
    background: var(--input-focus);
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1)
}

.input-field label {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--subtext);
    font-size: 15px;
    pointer-events: none;
    transition: all 0.2s var(--ease);
    direction: rtl;
    transform-origin: right center
}

.input-field input:focus~label,
.input-field input:not(:placeholder-shown)~label {
    top: 14px;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    transform: translateY(0)
}

.pw-toggle {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--subtext);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
    font-size: 18px
}

.pw-toggle:hover {
    color: var(--text)
}

.input-field.has-toggle input {
    padding-left: 48px
}

.btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    transition: all 0.15s var(--ease);
    margin-top: 10px
}

.btn:active {
    transform: scale(0.98)
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-dark) 0%, var(--accent) 100%);
    color: #fff;
    box-shadow: 0 4px 20px var(--accent-glow)
}

.btn-primary:hover {
    box-shadow: 0 6px 28px rgba(37, 211, 102, 0.4);
    filter: brightness(1.1)
}

.btn-primary .shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.15) 50%, transparent 100%);
    animation: shimmer 3s ease-in-out infinite
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 28px;
    color: var(--accent);
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    padding: 8px 0;
    transition: opacity 0.2s;
    text-align: center
}

.nav-link:hover {
    opacity: 0.8;
    text-decoration: underline
}

.toast {
    position: fixed;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 260px;
    max-width: 88%;
    padding: 14px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 9999;
    font-size: 14px;
    font-weight: 600;
    transition: top 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px)
}

.toast.show {
    top: 20px
}

.toast-success {
    background: rgba(7, 94, 84, 0.92);
    color: var(--accent);
    border: 1px solid rgba(37, 211, 102, 0.3)
}

.toast-error {
    background: rgba(60, 20, 20, 0.92);
    color: var(--error);
    border: 1px solid rgba(234, 67, 53, 0.25)
}

.toast-info {
    background: rgba(31, 44, 52, 0.92);
    color: var(--accent);
    border: 1px solid rgba(37, 211, 102, 0.2)
}

.toast-icon {
    font-size: 18px;
    flex-shrink: 0
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite
}

.field-error {
    font-size: 12px;
    color: var(--error);
    margin-top: -12px;
    margin-bottom: 10px;
    width: 100%;
    padding: 0 4px;
    display: none;
    direction: rtl
}

.field-error.visible {
    display: block
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    transform: scale(0);
    animation: rippleAnim .6s ease-out forwards;
    pointer-events: none
}

@keyframes shimmer {
    0% {
        left: -100%
    }
    100% {
        left: 200%
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

@keyframes glowPulse {
    0%, 100% {
        transform: scale(1);
        opacity: .5
    }
    50% {
        transform: scale(1.2);
        opacity: .2
    }
}

@keyframes rippleAnim {
    to {
        transform: scale(4);
        opacity: 0
    }
}

@media (max-width: 480px) {
    body {
        padding: 12px;
        align-items: flex-start;
        padding-top: 40px
    }
    .app {
        padding: 36px 24px;
        border-radius: 20px
    }
}

@media (max-width: 360px) {
    .app {
        padding: 28px 20px
    }
    .input-field input {
        font-size: 14px;
        padding: 20px 14px 8px
    }
}