/* Registration Page Styles - Harleton Community */

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

:root {
    --primary: #1a365d;
    --primary-dark: #0f2440;
    --secondary: #c05621;
    --accent: #ecc94b;
    --light: #f7fafc;
    --dark: #1a202c;
    --gray-100: #f7fafc;
    --gray-200: #edf2f7;
    --gray-300: #e2e8f0;
    --gray-400: #cbd5e0;
    --gray-500: #a0aec0;
    --gray-600: #718096;
    --gray-700: #4a5568;
    --success: #38a169;
    --error: #e53e3e;
    --error-light: #fed7d7;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: linear-gradient(135deg, var(--primary) 0%, #2d3748 50%, var(--secondary) 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation */
nav {
    background: rgba(26, 54, 93, 0.95);
    padding: 1rem 2rem;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

nav ul {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    list-style: none;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
    padding: 0 1rem;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

nav a:hover,
nav a.active {
    background: var(--secondary);
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.register-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 480px;
    overflow: hidden;
}

.register-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.register-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.register-header p {
    opacity: 0.9;
    font-size: 1rem;
}

/* Form Styles */
.register-form {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

.input-wrapper {
    display: flex;
    align-items: stretch;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: var(--primary);
}

.input-wrapper input {
    flex: 1;
    border: none;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    outline: none;
}

.domain-suffix {
    background: var(--gray-100);
    padding: 0.875rem 1rem;
    color: var(--gray-600);
    font-weight: 500;
    border-left: 2px solid var(--gray-300);
    white-space: nowrap;
}

input[type="password"],
input[type="email"],
.form-group > input[type="text"],
.password-wrapper > input[type="text"] {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    transition: border-color 0.3s ease;
}

input:focus {
    outline: none;
    border-color: var(--primary);
}

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

.hint {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--gray-500);
}

.error-message {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--error);
    min-height: 1.2em;
}

/* Password Toggle */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: stretch;
}

.password-wrapper input {
    flex: 1;
    padding-right: 3rem;
}

.toggle-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--gray-500);
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: var(--primary);
}

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

/* Password Requirements */
.password-requirements {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.req {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: var(--gray-100);
    border-radius: 4px;
    color: var(--gray-600);
    transition: all 0.3s ease;
}

.req.valid {
    background: #c6f6d5;
    color: var(--success);
}

/* Turnstile */
.turnstile-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--secondary) 0%, #9c4221 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(192, 86, 33, 0.4);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

.submit-btn .btn-loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.submit-btn.loading .btn-loading {
    display: flex;
}

.spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

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

.terms {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--gray-500);
    text-align: center;
}

/* Success Message */
.success-message {
    padding: 3rem 2rem;
    text-align: center;
}

.success-icon {
    width: 80px;
    height: 80px;
    color: var(--success);
    margin-bottom: 1.5rem;
}

.success-message h2 {
    color: var(--primary);
    margin-bottom: 1rem;
}

.email-created {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--gray-700);
}

.email-created strong {
    color: var(--primary);
}

.webmail-btn {
    display: inline-block;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.webmail-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 54, 93, 0.4);
}

.webmail-note {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--gray-500);
}

/* Footer */
footer {
    text-align: center;
    padding: 1.5rem;
    color: rgba(255, 255, 255, 0.7);
}

footer a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: white;
    text-decoration: underline;
}

.forgot-link {
    margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 520px) {
    main {
        padding: 1rem;
    }

    .register-header {
        padding: 1.5rem;
    }

    .register-header h1 {
        font-size: 1.5rem;
    }

    .register-form {
        padding: 1.5rem;
    }

    nav ul {
        gap: 1rem;
    }

    nav a {
        font-size: 0.85rem;
        padding: 0.4rem 0.75rem;
    }

    .domain-suffix {
        padding: 0.875rem 0.5rem;
        font-size: 0.9rem;
    }

    .password-requirements {
        flex-direction: column;
    }
}
