@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #0d0d0d;
    color: #e0e0e0;
    color-scheme: dark;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-box {
    background: #161616;
    border: 1px solid #2a2a2a;
    border-radius: 16px;
    padding: 40px 35px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.logo {
    text-align: center;
    margin-bottom: 6px;
}

.logo h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #00e639;
}

.subtitle {
    text-align: center;
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 32px;
    font-weight: 400;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #999;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    background: #1e1e1e;
    border: 1.5px solid #2a2a2a;
    border-radius: 10px;
    color: #e0e0e0;
    caret-color: #e0e0e0;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s ease;
}

.form-group input:not(:placeholder-shown) {
    -webkit-text-fill-color: #e0e0e0;
}

.form-group input::placeholder {
    color: rgba(224, 224, 224, 0.18) !important;
    -webkit-text-fill-color: rgba(224, 224, 224, 0.18);
    opacity: 1 !important;
}

.form-group input:focus::placeholder {
    color: rgba(224, 224, 224, 0.12) !important;
    -webkit-text-fill-color: rgba(224, 224, 224, 0.12);
}

.form-group input:focus {
    border-color: #00e639;
    box-shadow: 0 0 0 3px rgba(0, 230, 57, 0.1);
    background: #1a1a1a;
    color: #e0e0e0;
}

.form-group input:focus:not(:placeholder-shown) {
    -webkit-text-fill-color: #e0e0e0;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-text-fill-color: #e0e0e0 !important;
    -webkit-box-shadow: 0 0 0 9999px #1e1e1e inset !important;
    box-shadow: 0 0 0 9999px #1e1e1e inset !important;
    border: 1.5px solid #2a2a2a !important;
    transition: background-color 9999s ease-in-out 0s;
    color: #e0e0e0 !important;
    caret-color: #e0e0e0 !important;
    background-color: #1e1e1e !important;
}

.optional-tag {
    color: #555;
    font-weight: 400;
    font-size: 0.8rem;
}

/* Password eye toggle */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 48px;
}

.eye-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #555;
    font-size: 1.1rem;
    user-select: none;
    transition: color 0.2s;
    line-height: 1;
}

.eye-toggle:hover {
    color: #00e639;
}

.eye-toggle.active {
    color: #00e639;
}

/* Button */
.btn {
    width: 100%;
    padding: 13px;
    background: #00e639;
    border: none;
    border-radius: 10px;
    color: #0d0d0d;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.btn:hover:not(.loading) {
    background: #00cc33;
    box-shadow: 0 4px 16px rgba(0, 230, 57, 0.25);
}

/* Button loading state */
.btn .btn-loader {
    display: none;
}

.btn.loading .btn-text {
    display: none;
}

.btn.loading .btn-loader {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(13, 13, 13, 0.3);
    border-top-color: #0d0d0d;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* Links */
.link-text {
    text-align: center;
    margin-top: 24px;
    font-size: 0.85rem;
    color: #666;
}

.link-text a {
    color: #00e639;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.link-text a:hover {
    color: #00ff41;
    text-decoration: underline;
}

/* Flash messages */
.flash {
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 10px;
    font-size: 0.85rem;
}

.flash.success {
    background: rgba(0, 230, 57, 0.1);
    border: 1px solid rgba(0, 230, 57, 0.25);
    color: #00e639;
}

.flash.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #ef4444;
}

/* Error Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
    animation: modal-fade-in 0.25s ease;
}

@keyframes modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-box {
    background: #161616;
    border: 1px solid #2a2a2a;
    border-radius: 16px;
    padding: 28px 30px;
    max-width: 380px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modal-slide-in 0.25s ease;
}

@keyframes modal-slide-in {
    from { transform: translateY(-15px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.modal-icon {
    width: 40px;
    height: 40px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
    font-size: 1.2rem;
    font-weight: 700;
    flex-shrink: 0;
}

.modal-title {
    color: #e0e0e0;
    font-size: 1rem;
    font-weight: 600;
}

.modal-body {
    margin-bottom: 24px;
}

.modal-body p {
    color: #999;
    font-size: 0.9rem;
    line-height: 1.5;
}

.modal-btn {
    width: 100%;
    padding: 12px;
    background: #ef4444;
    border: none;
    border-radius: 10px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-btn:hover {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    background: #161616;
    border-bottom: 1px solid #2a2a2a;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.dashboard-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #00e639;
}

.btn-logout {
    padding: 8px 20px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 8px;
    color: #ef4444;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
}

.dashboard-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    text-align: center;
}

.welcome-text {
    color: #666;
    font-size: 1.1rem;
}

.welcome-text span {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    margin-top: 12px;
    color: #00e639;
}

/* Admin Dashboard */
.admin-body {
    display: block;
    background:
        radial-gradient(circle at top left, rgba(0, 230, 57, 0.18), transparent 28%),
        radial-gradient(circle at top right, rgba(239, 68, 68, 0.12), transparent 24%),
        linear-gradient(180deg, #07110b 0%, #050706 100%);
    color: #e7f8eb;
}

.admin-shell {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 36px 24px 56px;
    min-height: 100vh;
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 22px 24px;
    border: 1px solid rgba(84, 255, 133, 0.14);
    border-radius: 22px;
    background: rgba(7, 13, 9, 0.82);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(12px);
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    margin-bottom: 14px;
    border: 1px solid rgba(84, 255, 133, 0.28);
    border-radius: 999px;
    background: rgba(0, 230, 57, 0.1);
    color: #7dff9f;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.admin-topbar h1 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1;
    margin-bottom: 10px;
    color: #f4fff6;
}

.admin-subtitle {
    max-width: 620px;
    color: rgba(231, 248, 235, 0.72);
    font-size: 1rem;
    line-height: 1.6;
}

.admin-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.85fr);
    gap: 24px;
    margin-top: 28px;
}

.admin-hero-copy,
.admin-hero-card,
.admin-panel {
    border: 1px solid rgba(84, 255, 133, 0.12);
    border-radius: 24px;
    background: rgba(6, 10, 8, 0.84);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}

.admin-hero-copy {
    padding: 32px;
}

.admin-kicker {
    color: #7dff9f;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 14px;
}

.admin-hero-copy h2 {
    font-size: clamp(1.8rem, 3vw, 3rem);
    line-height: 1.08;
    max-width: 12ch;
    margin-bottom: 16px;
    color: #f4fff6;
}

.admin-hero-copy h2 span {
    color: #7dff9f;
}

.admin-hero-copy p:last-child {
    max-width: 58ch;
    color: rgba(231, 248, 235, 0.7);
    line-height: 1.75;
}

.admin-hero-card {
    padding: 28px;
    background:
        linear-gradient(180deg, rgba(0, 230, 57, 0.12), rgba(0, 230, 57, 0.04)),
        rgba(6, 10, 8, 0.88);
}

.admin-card-label,
.admin-panel-title {
    display: block;
    margin-bottom: 14px;
    color: rgba(231, 248, 235, 0.56);
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.admin-hero-card strong {
    display: block;
    font-size: 2.3rem;
    color: #f4fff6;
    margin-bottom: 12px;
}

.admin-hero-card p {
    color: rgba(231, 248, 235, 0.72);
    line-height: 1.7;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.admin-panel {
    padding: 28px;
}

.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.admin-stat {
    padding: 18px;
    border: 1px solid rgba(84, 255, 133, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.02);
}

.admin-stat strong {
    display: block;
    margin-bottom: 8px;
    color: #7dff9f;
    font-size: 1.5rem;
}

.admin-stat span,
.admin-action-item {
    color: rgba(231, 248, 235, 0.76);
    line-height: 1.6;
}

.admin-action-list {
    display: grid;
    gap: 14px;
}

.admin-action-item {
    padding: 16px 18px;
    border-left: 3px solid #00e639;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
}

@media (max-width: 900px) {
    .admin-topbar,
    .admin-hero,
    .admin-grid,
    .admin-stat-grid {
        grid-template-columns: 1fr;
    }

    .admin-topbar {
        align-items: flex-start;
        flex-direction: column;
    }
}
