:root {
    --bg-color: #0b0f19;
    --surface-color: rgba(17, 24, 39, 0.7);
    --primary-color: #f59e0b;
    /* Amber */
    --primary-hover: #fbbf24;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(245, 158, 11, 0.2);
    --border-focus: rgba(245, 158, 11, 0.8);
    --error: #ef4444;
    --success: #10b981;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    padding: 2rem 1rem;
}

/* Background Effects */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.15;
    animation: drift 20s infinite alternate ease-in-out;
}

.glow-1 {
    width: 50vw;
    height: 50vw;
    background: var(--primary-color);
    top: -20%;
    right: -10%;
}

.glow-2 {
    width: 40vw;
    height: 40vw;
    background: #3b82f6;
    /* Blueish to contrast */
    bottom: -10%;
    left: -20%;
    animation-delay: -5s;
}

@keyframes drift {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(-30px, 60px) scale(1.1);
    }
}

/* Container */
.container {
    width: 100%;
    max-width: 650px;
    z-index: 1;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 2.5rem;
    animation: fadeInDown 1s ease forwards;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);
}

.logo span {
    color: var(--primary-color);
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 80%;
    margin: 0 auto;
}

/* Form Panel */
.glass-panel {
    background: var(--surface-color);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 1s ease forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: flex;
    gap: 1.5rem;
}

.form-row .form-group {
    flex: 1;
}

label {
    display: flex;
    align-items: center;
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-main);
    letter-spacing: 0.5px;
}

input[type="text"],
input[type="date"],
input[type="url"],
input[type="email"],
textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 0.9rem 1.2rem;
    border-radius: 0.75rem;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15);
}

input::placeholder,
textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Google Drive Input */
.drive-label {
    color: var(--primary-hover);
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.drive-icon {
    position: absolute;
    right: 1.2rem;
    width: 22px;
    height: 22px;
    color: #10b981;
    /* Default Drive style */
}

.input-with-icon input {
    padding-right: 3.5rem;
}

.hint-text {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.tooltip-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    font-size: 12px;
    margin-right: 10px;
    cursor: help;
    position: relative;
    transition: background 0.3s;
}

.tooltip-icon:hover {
    background: rgba(255, 255, 255, 0.3);
}

.tooltip-icon:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 140%;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #fff;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    width: max-content;
    max-width: 250px;
    white-space: normal;
    text-align: center;
    z-index: 10;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Legal Section */
.legal-section {
    background: rgba(245, 158, 11, 0.05);
    border-right: 4px solid var(--primary-color);
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 2.5rem;
    margin-top: 2rem;
    transition: transform 0.3s ease;
}

.legal-section:hover {
    transform: translateX(-5px);
    background: rgba(245, 158, 11, 0.08);
}

.legal-section h3 {
    font-size: 1.15rem;
    margin-bottom: 1.2rem;
    color: var(--primary-color);
}

.custom-checkbox {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    position: relative;
    margin-bottom: 1.2rem;
    user-select: none;
}

.custom-checkbox:last-child {
    margin-bottom: 0;
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    min-width: 26px;
    height: 26px;
    background-color: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: 15px;
    margin-top: 2px;
    transition: all 0.2s ease;
}

.custom-checkbox:hover input~.checkmark {
    border-color: var(--primary-hover);
    background-color: rgba(0, 0, 0, 0.6);
}

.custom-checkbox input:checked~.checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.checkmark:after {
    content: "";
    display: none;
    width: 6px;
    height: 12px;
    border: solid #000;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.custom-checkbox input:checked~.checkmark:after {
    display: block;
}

.checkbox-text {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 400;
    line-height: 1.6;
}

.checkbox-text strong {
    color: var(--text-main);
}

/* Button */
.submit-wrapper {
    text-align: center;
}

.primary-btn {
    width: 100%;
    padding: 1.1rem;
    background: linear-gradient(135deg, var(--primary-hover), var(--primary-color));
    color: #000;
    border: none;
    border-radius: 0.75rem;
    font-size: 1.15rem;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 20px -5px rgba(245, 158, 11, 0.4);
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px -5px rgba(245, 158, 11, 0.5);
    filter: brightness(1.1);
}

.primary-btn:active {
    transform: translateY(1px);
    box-shadow: 0 5px 10px -5px rgba(245, 158, 11, 0.4);
}

/* Loading Spinner */
.spinner {
    animation: rotate 2s linear infinite;
    width: 26px;
    height: 26px;
}

.spinner .path {
    stroke: #000;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }

    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }

    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

.form-feedback {
    margin-top: 1.2rem;
    font-size: 1rem;
    font-weight: 700;
    min-height: 24px;
    transition: color 0.3s ease;
}

/* Shake Animation for Invalid Inputs */
@keyframes shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }

    100% {
        transform: translateX(0);
    }
}

.shake {
    animation: shake 0.5s;
}

/* Responsive */
@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .glass-panel {
        padding: 1.5rem;
    }

    .logo {
        font-size: 2.5rem;
    }
}

/* Admin Key (Subtle Login) */
.admin-key {
    position: fixed;
    bottom: 20px;
    right: 20px;
    color: rgba(255, 255, 255, 0.15);
    cursor: pointer;
    z-index: 50;
    transition: color 0.3s;
}

.admin-key:hover {
    color: var(--primary-color);
}

/* Admin Auth Modal Specifics */
.admin-auth-modal {
    max-width: 400px;
    text-align: center;
}

.admin-auth-modal h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.admin-auth-modal input[type="password"] {
    text-align: center;
    letter-spacing: 2px;
}

.auth-error {
    color: var(--error);
    display: none;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    font-weight: 700;
}

/* Generic Modal Overlay reuse */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal {
    width: 90%;
    background: var(--surface-color);
    padding: 2.5rem;
    border-radius: 1.5rem;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #fff;
}