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

:root {
    --brand-primary: #667eea;
    --brand-secondary: #764ba2;
    --brand-gradient: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    --brand-shadow-strong: 0 8px 25px rgba(102, 126, 234, 0.4);
    --brand-shadow-soft: 0 4px 15px rgba(102, 126, 234, 0.3);
    --brand-surface: rgba(255, 255, 255, 0.85);
    --brand-border: rgba(102, 126, 234, 0.2);
    --brand-text: #2f3f86;
    --text-muted: #6c757d;
    --text-subtle: #4c5c96;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--brand-gradient);
    background-image:
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.3) 0%, transparent 50%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0%,
    100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.auth-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 40px;
    width: 100%;
    max-width: 450px;
    animation: slideInUp 0.6s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.auth-header h1 {
    color: #282d3b;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 10px;
}

.auth-header p {
    font-size: 14px;
    line-height: 1.5;
}

.auth-header p,
.account-section p {
    color: var(--text-muted);
}

.success-message {
    margin-bottom: 24px;
    color: var(--text-muted);
    font-size: 15px;
}

.auth-header a {
    color: #282d3b;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 14px;
    font-weight: 600;
}

.auth-header a:hover {
    color: #1e222c;
    text-decoration: underline;
}

.menu a,
.forgot-password a {
    color: var(--brand-primary);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 14px;
}

.menu a:hover,
.forgot-password a:hover {
    color: #5a6fd8;
    text-decoration: underline;
}

.auth-container .confirm-text {
    text-align: center;
    margin-top: -1rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #495057;
    font-weight: 500;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: rgba(255, 255, 255, 1);
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
    transform: scale(1.2);
}

.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.checkbox-group label {
    margin-bottom: 0;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 14px;
}

.btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn,
.p-button {
    border-radius: 12px;
    font-weight: 600;
}

.btn-inline,
.p-button.p-button-rounded {
    width: auto;
    min-width: 140px;
    padding: 12px 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary,
.p-button.p-button-primary {
    background: var(--brand-gradient);
    color: #fff;
    box-shadow: var(--brand-shadow-soft);
}

.btn-primary:hover,
.p-button.p-button-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--brand-shadow-strong);
}

.auth-container .btn-primary {
    background: #282d3b;
    color: #fff;
    box-shadow: 0 4px 15px rgba(40, 45, 59, 0.3);
}

.auth-container .btn-primary:hover {
    background: #1e222c;
    box-shadow: 0 8px 25px rgba(40, 45, 59, 0.4);
}

.btn-outline,
.p-button.p-button-outlined {
    background: transparent;
    color: var(--brand-primary);
    border: 2px solid var(--brand-primary);
    margin-top: 10px;
}

.btn-outline:hover,
.p-button.p-button-outlined:hover {
    background: var(--brand-primary);
    color: #fff;
}

.btn-danger,
.p-button.p-button-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #e63946 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(230, 57, 70, 0.3);
}

.btn-danger:hover,
.p-button.p-button-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(230, 57, 70, 0.35);
}

.messages {
    margin-bottom: 20px;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 15px;
    border: none;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.menu {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
}

.menu strong {
    color: var(--brand-primary);
    font-size: 14px;
    display: block;
    margin-bottom: 10px;
}

.menu ul {
    list-style: none;
}

.menu li {
    margin-bottom: 8px;
}

.menu-logout-form {
    display: inline-block;
    margin-top: 6px;
}

.menu-signout-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.account-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.account-section h1 {
    font-size: 26px;
    color: var(--brand-text);
    font-weight: 600;
}

.account-section h2 {
    font-size: 20px;
    color: var(--brand-text);
    font-weight: 600;
}

.account-section p {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.6;
}

.email-card-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.email-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--brand-surface);
    border: 1px solid rgba(102, 126, 234, 0.25);
    border-radius: 14px;
    padding: 16px 18px;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.email-card:hover {
    border-color: rgba(102, 126, 234, 0.6);
    box-shadow: 0 12px 26px rgba(102, 126, 234, 0.15);
}

.email-card input[type="radio"] {
    transform: scale(1.15);
    accent-color: var(--brand-primary);
    flex-shrink: 0;
}

.email-card-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.email-address {
    font-weight: 600;
    color: var(--brand-text);
    font-size: 16px;
}

.email-status {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.status-chip-primary {
    background: rgba(102, 126, 234, 0.15);
    color: #3f51b5;
}

.status-chip-verified {
    background: rgba(46, 204, 113, 0.15);
    color: #2e8b57;
}

.status-chip-unverified {
    background: rgba(255, 193, 7, 0.2);
    color: #b7791f;
}

.email-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.divider {
    height: 1px;
    background: rgba(102, 126, 234, 0.2);
    margin: 25px 0 10px;
}

.email-add-form {
    background: var(--brand-surface);
    border: 1px solid var(--brand-border);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 14px 30px rgba(102, 126, 234, 0.12);
}

.empty-state {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid var(--brand-border);
    border-radius: 18px;
    padding: 26px;
    text-align: center;
    color: var(--text-subtle);
    box-shadow: 0 12px 28px rgba(102, 126, 234, 0.08);
}

.empty-state h2 {
    margin-bottom: 10px;
    font-size: 22px;
    font-weight: 600;
    color: var(--brand-text);
}

.empty-state p {
    margin-bottom: 0;
    font-size: 14px;
}

.connection-section {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.provider-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}

.provider-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px;
    border-radius: 16px;
    border: 1px solid rgba(102, 126, 234, 0.25);
    background: var(--brand-surface);
    box-shadow: 0 10px 24px rgba(102, 126, 234, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.provider-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(102, 126, 234, 0.18);
}

.provider-card button,
.provider-card a {
    width: 100%;
}

.connection-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.connection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    border-radius: 14px;
    background: var(--brand-surface);
    border: 1px solid var(--brand-border);
    box-shadow: 0 12px 28px rgba(102, 126, 234, 0.1);
}

.connection-item strong {
    color: var(--brand-text);
}

.account-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-help {
    margin-top: 8px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(102, 126, 234, 0.08);
    color: #4154a8;
    font-size: 13px;
    line-height: 1.6;
}

.form-help ul {
    margin: 8px 0 0 20px;
}

.form-help li {
    margin-bottom: 6px;
}

.form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.form-actions .btn {
    margin-top: 0;
}

.form-actions .btn-outline {
    margin-top: 0;
}

.form-errors {
    margin-bottom: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    background: rgba(255, 90, 95, 0.1);
    color: #c53030;
    font-size: 14px;
}

.form-errors ul {
    margin: 0;
    padding-left: 18px;
}

.social-login {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e1e5e9;
    text-align: center;
}

.social-login p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 15px;
}

.social-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.social-btn.apple {
    background: #000;
}

.social-btn.google {
    background: #db4437;
}

.social-btn.linkedin {
    background: #0077b5;
}

.forgot-password {
    text-align: right;
    margin-bottom: 20px;
}

.logout-info {
    text-align: center;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--brand-border);
    border-radius: 16px;
    padding: 30px 25px;
    color: #4a4f5a;
    line-height: 1.6;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.08);
}

.logout-info h1 {
    color: var(--brand-text);
    font-size: 26px;
    margin-bottom: 12px;
    font-weight: 600;
}

.logout-info p {
    margin-bottom: 12px;
    font-size: 15px;
}

.logout-info .btn {
    width: auto;
    min-width: 160px;
    padding: 12px 24px;
    margin-top: 10px;
}

@media (max-width: 480px) {
    .auth-container {
        padding: 30px 20px;
        margin: 0 15px;
    }

    .auth-header h1 {
        font-size: 24px;
    }

    .form-group input {
        padding: 12px 15px;
        font-size: 16px;
    }

    .social-buttons {
        gap: 10px;
    }

    .social-btn {
        width: 45px;
        height: 45px;
    }

    .email-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .connection-item {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .provider-grid {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

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

.form-group input:focus,
.btn:focus {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

/* Password requirements list styling */
.form-group ul,
.form-help ul {
    margin: 8px 0 0 20px;
    padding-left: 0;
    list-style-position: outside;
}

.form-group ul li,
.form-help ul li {
    margin-bottom: 6px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-muted);
}

.form-group ul {
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    padding: 10px 10px 10px 30px;
    margin-top: 10px;
}

/* Ensure proper spacing for form elements */
.form-group p {
    margin-bottom: 8px;
}

.form-group .helptext {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

/* Button form styling (for cancel buttons with form attribute) */
button[type="submit"] {
    cursor: pointer;
    transition: all 0.3s ease;
}

button[form="logout-from-stage"] {
    margin-top: 0;
}