/* Lifted from page-auth-methods.php <style>; PHP role colors → CSS vars */
.auth-page {
    --auth-primary: #3BD3D3;
    --auth-primary-hover: #2ECECE;
    --auth-focus: rgba(59, 211, 211, 0.5);
    --auth-focus-shadow: rgba(59, 211, 211, 0.15);
    --auth-glow: rgba(59, 211, 211, 0.3);
    --auth-otp-bg: rgba(59, 211, 211, 0.06);
    --auth-info-bg: rgba(59, 211, 211, 0.1);
    --primary: var(--auth-primary);
    --primary-hover: var(--auth-primary-hover);
    --bg-dark: #000;
    --card-bg: rgba(255, 255, 255, 0.03);
    --border: rgba(255, 255, 255, 0.12);
    --border-focus: var(--auth-focus);
    --text: rgba(255, 255, 255, 0.95);
    --text-muted: rgba(255, 255, 255, 0.6);
    --danger: #ef4444;
    --success: #10b981;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
	min-height: 90vh;
}

/* Light theme: deep teal for text/focus (AAA); bright cyan only on filled send */
body.light-theme .auth-page[data-role='creator'],
html[data-theme='light'] .auth-page[data-role='creator'] {
    --auth-primary: #045a55;
    --auth-primary-hover: #033f3b;
    --auth-focus: rgba(4, 90, 85, 0.45);
    --auth-focus-shadow: rgba(4, 90, 85, 0.15);
    --auth-glow: rgba(4, 90, 85, 0.25);
    --auth-otp-bg: rgba(4, 90, 85, 0.06);
    --auth-info-bg: rgba(4, 90, 85, 0.1);
}

body.light-theme .auth-page[data-role='employer'],
body.light-theme .auth-page[data-role='client'],
html[data-theme='light'] .auth-page[data-role='employer'],
html[data-theme='light'] .auth-page[data-role='client'] {
    --auth-primary: #c9a227;
    --auth-primary-hover: #a6851c;
    --auth-focus: rgba(201, 162, 39, 0.45);
    --auth-focus-shadow: rgba(201, 162, 39, 0.15);
    --auth-glow: rgba(201, 162, 39, 0.25);
    --auth-otp-bg: rgba(201, 162, 39, 0.08);
    --auth-info-bg: rgba(201, 162, 39, 0.12);
}
.auth-page[data-role="employer"],
.auth-page[data-role="client"] {
    --auth-primary: #f9d654;
    --auth-primary-hover: #d4a42a;
    --auth-focus: rgba(249, 214, 84, 0.5);
    --auth-focus-shadow: rgba(249, 214, 84, 0.15);
    --auth-glow: rgba(249, 214, 84, 0.3);
    --auth-otp-bg: rgba(249, 214, 84, 0.06);
    --auth-info-bg: rgba(249, 214, 84, 0.1);
}
.auth-page[data-role="employer"] .auth-form #contact-send-btn,
.auth-page[data-role="client"] .auth-form #contact-send-btn {
    background: var(--gold-400) !important;
}
.auth-page[data-role="employer"] .auth-form #contact-send-btn:hover:not(:disabled),
.auth-page[data-role="client"] .auth-form #contact-send-btn:hover:not(:disabled) {
    background: var(--gold-500) !important;
}


@media (max-width: 768px) {
	.auth-form-container {
		width: 90% !important;
    	max-width: 720px !important;
	}
}

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

@media (max-width: 768px) {
	.auth-header {
		margin-top: 3em !important;
	}
}

.auth-header h1 {
    font-family: var(--font-family-heading);
    font-size: clamp(2rem,6vw,5.5rem) !important;
    font-weight: 700;
    color: var(--brand-white) !important;
    margin: 0 0 8px;
	line-height: 0.9 !important;
}

.auth-header p {
    color: var(--text-muted);
    font-size: clamp(1.2rem,2vw,2.5rem) !important;
    margin: 0 0 16px;
	opacity: 0.55;
}


.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--gradient-midnight);
    color: var(--brand-white) !important;
    font-weight: 600;
    font-size: var(--font-size-base);
	margin-top: 1em !important;
}

.auth-form {
    background: var(--card-bg);
    border: 1px solid var(--midnight-end);
    border-radius: 16px;
    padding: 32px 28px;
}

/* Social Buttons */
.social-buttons {
    display: flex;
    flex-direction: row;
    gap: 12px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .social-buttons {
        flex-direction: column;
    }
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--brand-white) !important;
}

.social-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

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

.social-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.social-btn.google-btn:hover {
    border-color: rgba(66, 133, 244, 0.5);
}

.social-btn.apple-btn:hover {
    border-color: rgba(255, 255, 255, 0.3);
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: var(--font-size-base);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gradient-midnight);
}

/* Input Groups (scoped) */
.auth-form .input-section {
    margin-bottom: 12px;
}

.auth-form .input-section:last-of-type {
    margin-bottom: 0;
}

.auth-form .input-label {
    display: block;
    color: var(--text);
    font-size: var(--font-size-base);
    font-weight: 500;
    margin-bottom: 8px;
}

.auth-form .input-group {
    display: flex;
    gap: 10px;
	flex-direction: column;
}

.auth-form .input-field {
    flex: 1;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid var(--midnight-end) !important;
    background: rgba(0, 0, 0, 0.0);
    color: var(--text);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.auth-form .input-field:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px var(--auth-focus-shadow);
}

.auth-form .input-field::placeholder {
    color: var(--text-muted);
}

.auth-form .input-field:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Override browser autofill styles to maintain dark theme */
.auth-form .input-field:-webkit-autofill,
.auth-form .input-field:-webkit-autofill:hover,
.auth-form .input-field:-webkit-autofill:focus,
.auth-form .input-field:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px rgba(0, 0, 0, 0.4) inset !important;
    -webkit-text-fill-color: var(--text) !important;
    border-color: var(--border) !important;
    background-color: transparent !important;
}

.auth-form .input-field:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 30px rgba(0, 0, 0, 0.4) inset, 0 0 0 3px var(--auth-focus-shadow) !important;
    border-color: var(--primary) !important;
}

.auth-form .send-btn {
    padding: 14px 20px;
    border-radius: 10px;
    border: none;
    background: var(--primary-400) !important;
    color: #000 !important;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.auth-form .send-btn:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--auth-glow);
}

.auth-form .send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-form .send-btn.loading {
    color: transparent;
    position: relative;
}

.auth-form .send-btn.loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin-left: -9px;
    margin-top: -9px;
    border: 2px solid transparent;
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}



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

/* OTP Section */
.otp-section {
    padding: 20px;
    background: var(--auth-otp-bg);
    border: 1px solid var(--midnight-end);
    border-radius: 12px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.otp-section.hidden {
    display: none;
}

.otp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.otp-title {
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
}

.otp-edit-btn {
    background: none;
    border: none;
    color: var(--text-muted) !important;
    font-size: var(--font-size-base);
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}


.otp-sent-to {
    color: var(--text-muted) !important;
    font-size: var(--font-size-base);
    margin: 0 0 12px;
}

.otp-sent-to strong {
    color: var(--brand-white) !important;
}

.otp-input-group {
    display: flex;
    gap: 10px;
}

.otp-input {
    flex: 1 !important;
    padding: 14px 16px !important;
    border-radius: 10px !important;
    border: 1px solid var(--midnight-end) !important;
    background: transparent !important;
    color: var(--text) !important;
    font-size: 1.1rem !important;
    letter-spacing: 4px !important;
    text-align: center !important;
    font-weight: 600 !important;
}

.otp-input--code {
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace !important;
    font-size: 1.4rem !important;
    letter-spacing: 0.4em !important;
    padding-left: 1.15rem !important;
}

.otp-input--code::placeholder {
    letter-spacing: 0.4em !important;
    color: rgba(252, 255, 255, 0.28) !important;
}

.otp-input:focus {
    outline: none;
}

/* Override browser autofill styles for OTP input */
.otp-input:-webkit-autofill,
.otp-input:-webkit-autofill:hover,
.otp-input:-webkit-autofill:focus,
.otp-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px rgba(0, 0, 0, 0.4) inset !important;
    -webkit-text-fill-color: var(--text) !important;
    border-color: var(--auth-glow) !important;
    background-color: rgba(0, 0, 0, 0.4) !important;
}

.otp-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 30px rgba(0, 0, 0, 0.4) inset, 0 0 0 3px var(--auth-focus-shadow) !important;
    border-color: var(--primary) !important;
}

.verify-btn {
    padding: 14px 24px !important;
    border-radius: 10px !important;
    border: none !important;
    background: var(--midnight-end) !important;
    color: var(--brand-white) !important;
    font-size: var(--font-size-base) !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.verify-btn:hover:not(:disabled) {
    transform: translateY(-1px) !important;
}

.verify-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.verify-btn.loading {
    color: transparent;
    position: relative;
}

.verify-btn.loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin-left: -9px;
    margin-top: -9px;
    border: 2px solid transparent;
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* Status Messages */
.status-message {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
}

.status-message.hidden {
    display: none;
}

.status-message.error {
    background: rgba(239, 68, 68, 0.4);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--brand-white) !important;
}

.status-message.success {
    background: rgba(16, 185, 129, 0.4);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--brand-white) !important;
}

.status-message.info {
    background: var(--auth-info-bg);
    border: 1px solid var(--auth-glow);
    color: var(--brand-white) !important;
}

/* Terms */
.auth-terms {
    margin-top: 20px;
}

.auth-terms-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.5;
}

.auth-terms-checkbox {
    appearance: auto;
    width: 18px;
    height: 18px;
    min-width: 18px;
    border-radius: 4px;
    border: 1px solid var(--midnight-end);
    background: transparent;
    cursor: pointer;
    margin-top: 1px;
    accent-color: var(--midnight-end);
}

.auth-terms-label a {
    color: var(--text-muted) !important;
    text-decoration: underline;
	font-weight: bold;
}

@media (max-width: 768px) {
	.auth-terms-label a {
		padding: 0 !important;	
	}
}

.auth-terms-label a:hover {
    color: var(--brand-white) !important;
}

.auth-terms.terms-error .auth-terms-label {
    color: var(--danger);
}

.auth-terms.terms-error .auth-terms-checkbox {
    border-color: var(--danger);
    outline: 2px solid rgba(239, 68, 68, 0.3);
}

body.light-theme .auth-terms-label {
    color: var(--text-secondary);
}

body.light-theme .auth-terms-label a {
    color: var(--text-secondary) !important;
}

/* Footer */
.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.auth-footer a {
	color: var(--brand-white) !important;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
  border: 1px solid var(--midnight-end);
  border-radius: var(--radius-md);
  padding: 2px 8px !important;
  background: var(--gradient-midnight);
}

.auth-footer a:hover {
    text-decoration: underline;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--brand-white) !important;
    text-decoration: none;
    font-size: var(--font-size-base);
    margin-bottom: 24px;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--text);
}

.back-link svg {
    width: 18px;
    height: 18px;
}

/* Logout Warning */
.logout-warning {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    text-align: center;
}

.logout-warning-title {
    color: #ef4444;
    margin: 0 0 12px;
    font-size: 0.95rem;
    font-weight: 500;
}

.logout-warning-text {
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 16px;
    font-size: 0.9rem;
}

.logout-warning-btn {
    display: inline-block;
    background: #ef4444;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

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

@media (max-width: 480px) {
    .auth-form {
        padding: 24px 20px;
    }

    .auth-header h1 {
        font-size: 1.875rem;
    }

    .input-group {
        flex-direction: column;
    }

    .send-btn {
        width: 100%;
    }

    .otp-input-group {
        flex-direction: column;
    }

    .verify-btn {
        width: 100%;
    }
}

/* ========================================
   LIGHT THEME OVERRIDES
   ======================================== */
body.light-theme .auth-page {
    background: var(--bg-page);
}

body.light-theme .auth-header h1 {
    color: var(--text-primary) !important;
}

body.light-theme .auth-header p {
    color: var(--text-secondary);
}

body.light-theme .back-link {
    color: var(--text-primary) !important;
}

body.light-theme .auth-form {
    background: var(--bg-card);
    border-color: var(--border-subtle);
}

body.light-theme .social-btn {
    background: var(--bg-elevated) !important;
    border-color: var(--border-subtle) !important;
    color: var(--text-primary) !important;
}

body.light-theme .social-btn:hover {
    background: var(--bg-muted);
    border-color: var(--border-default);
}

body.light-theme .auth-divider {
    color: var(--text-secondary);
}

body.light-theme .auth-divider::before,
body.light-theme .auth-divider::after {
    background: var(--border-subtle);
}

body.light-theme .auth-form .input-label {
    color: var(--text-primary);
}

body.light-theme .auth-form .input-field {
    background: transparent;
	border: 1px solid var(--midnight-end);
    color: var(--text-primary);
}

body.light-theme .auth-form .input-field:focus {
    background: rgba(0, 0, 0, 0.02);
    border-color: var(--primary-500);
}

body.light-theme .auth-form .input-field::placeholder {
    color: var(--text-tertiary) !important;
}

body.light-theme .auth-form .input-field:-webkit-autofill,
body.light-theme .auth-form .input-field:-webkit-autofill:hover,
body.light-theme .auth-form .input-field:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 30px var(--bg-card) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    border-color: var(--border-subtle) !important;
}

body.light-theme .otp-input {
    background: var(--bg-input);
    color: var(--text-primary);
}

body.light-theme .otp-input:-webkit-autofill,
body.light-theme .otp-input:-webkit-autofill:hover,
body.light-theme .otp-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 30px var(--bg-card) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
}

body.light-theme .otp-sent-to {
    color: var(--text-secondary);
}

body.light-theme .otp-sent-to strong {
    color: var(--text-primary);
}

body.light-theme .otp-edit-btn {
    color: var(--text-secondary);
}

body.light-theme .otp-edit-btn:hover {
    color: var(--text-primary);
}

body.light-theme .auth-footer {
    color: var(--text-secondary);
}

body.light-theme .auth-footer a {
    color: #000 !important;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    border: 1px solid var(--midnight-end);
    border-radius: var(--radius-md);
    padding: 2px 8px;
    background: var(--gradient-midnight);
}

body.light-theme .logout-warning-text {
    color: var(--text-secondary);
}
