:root {
    /* Brand Colors based on Psynarios Logo */
    --primary-color: rgb(56, 66, 242);
    /* Vibrant Blue from Logo 'P' */
    --primary-hover: #2a32b5;
    /* Darker blue for hover */
    --accent-color: #3cd49c;
    /* Mint Green from Logo 'dot' */
    --text-dark: #1e1e2d;
    /* Softer black */
    --text-light: #5170ff;
    --text-light-fields: #8e8f91;
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --error-color: #ef4444;

    /* Spacing & Borders */
    --radius-md: 16px;
    /* Slightly rounder for modern feel */
    --radius-sm: 8px;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background-image: linear-gradient(135deg, #f0f2f5 0%, #e6e9f0 100%);
    /* Subtle gradient background */
}

.main-wrapper {
    width: 100%;
    max-width: 600px;
    /* Slightly narrower for better focus */
}

.form-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 48px;
    width: 100%;
    transition: transform 0.3s ease;
    border-top: 4px solid var(--accent-color);
    /* Nice top border accent */
}

.form-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo-container {
    margin-bottom: 24px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-img {
    max-height: 100%;
    max-width: 220px;
    object-fit: contain;
}

h1 {
    font-size: 20px;
    font-weight: 800;
    /* Bolder */
    color: var(--primary-color);
    /* Use Brand Blue */
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.form-description {
    color: var(--text-light);
    font-size: 17px;
}

.form-fields {
    color: var(--text-light-fields);
    font-size: 12px;
}

/* Form Groups */
.form-group {
    margin-bottom: 24px;
    position: relative;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-dark);
}

.required {
    color: var(--error-color);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 12px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    pointer-events: none;
    transition: color 0.3s ease;
}

.input-icon svg {
    width: 20px;
    height: 20px;
}

input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    /* Left padding space for icon */
    border: 1px solid #E5E7EB;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s ease;
    color: var(--text-dark);
    background-color: #F9FAFB;
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(67, 83, 255, 0.15);
}

input:focus+.input-icon,
.input-wrapper:focus-within .input-icon {
    color: var(--primary-color);
}

/* Validation States */
input.error {
    border-color: var(--error-color);
    background-color: #FEF2F2;
}

input.success {
    border-color: var(--accent-color);
}

.error-text {
    color: var(--error-color);
    font-size: 12px;
    margin-top: 6px;
    display: none;
    margin-left: 4px;
}

/* Button */
.submit-btn {
    width: 100%;
    padding: 14px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(67, 83, 255, 0.3);
}

.submit-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(67, 83, 255, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.btn-icon {
    width: 20px;
    height: 20px;
}

/* Loading Overlay */
#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #E5E7EB;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

.loading-text {
    font-weight: 500;
    color: var(--text-dark);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Messages */
#messageBox {
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.message-success {
    background-color: #ECFDF5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.message-error {
    background-color: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

/* Responsive */
@media (max-width: 480px) {
    .form-card {
        padding: 24px;
    }
}

/* Animated Waves */
.waves-container {
    position: fixed;
    top: 50%;
    /* Start exactly at the middle */
    left: 0;
    right: 0;
    bottom: 0;
    /* Fill all the way to the bottom */
    height: 60vh;
    /* Occupy the bottom half */
    z-index: -1;
    pointer-events: none;
    opacity: 0.8;
    overflow: hidden;
    /* Ensure no scrollbars */
}

/* Ensure the SVG stretches to cover the area but maintains wave shape at top */
.waves {
    position: absolute;
    top: -1px;
    /* Overlap slightly to prevent gap */
    width: 100%;
    height: 100%;
}



/* Animation */
.parallax>use {
    animation: move-forever 25s cubic-bezier(.55, .5, .45, .5) infinite;
}

.parallax>use:nth-child(1) {
    animation-delay: -2s;
    animation-duration: 7s;
}

.parallax>use:nth-child(2) {
    animation-delay: -3s;
    animation-duration: 10s;
}

.parallax>use:nth-child(3) {
    animation-delay: -4s;
    animation-duration: 13s;
}

.parallax>use:nth-child(4) {
    animation-delay: -5s;
    animation-duration: 20s;
}

@keyframes move-forever {
    0% {
        transform: translate3d(-90px, 0, 0);
    }

    100% {
        transform: translate3d(85px, 0, 0);
    }
}

/* Notification Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: white;
    padding: 32px;
    border-radius: var(--radius-md);
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

#modalTitle {
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 22px;
}

#modalMessage {
    color: var(--text-dark);
    margin-bottom: 24px;
    font-size: 16px;
    line-height: 1.5;
}

.modal-close-btn {
    padding: 12px 32px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-close-btn:hover {
    background: var(--primary-hover);
}

.modal-close-btn.error-btn {
    background: #4b5563;
}

.modal-close-btn.error-btn:hover {
    background: #374151;
}