/* ============================================
   Emerson College Password Services
   Brand Colors from brand.emerson.edu
   ============================================ */

:root {
    /* Primary Palette */
    --emerson-purple: #62259D;
    --emerson-purple-dark: #4a1c77;
    --emerson-purple-light: #7b3db5;
    --warm-gray: #706258;
    --warm-gray-light: #9a928a;
    
    /* Secondary Palette */
    --deep-purple: #2F1A45;
    --medium-purple: #742F8A;
    --teal: #4CC1BA;
    --blue: #00A7E1;
    
    /* UI Colors */
    --success-green: #28a745;
    --error-red: #dc3545;
    --warning-yellow: #ffc107;
    --text-primary: #333;
    --text-secondary: #666;
    --text-muted: #999;
    --border-color: #ddd;
    --background-light: #f8f9fa;
}

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

body {
    font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-primary);
    background: 
        linear-gradient(135deg, rgba(98, 37, 157, 0.75) 0%, rgba(47, 26, 69, 0.80) 100%),
        url('https://emerson.edu/sites/default/files/root/220825_CampusShots-1077-2_1.JPG');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
}

/* ============================================
   Page Layout
   ============================================ */

.page-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    padding: 1rem 2rem;
    background: var(--deep-purple);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo-link {
    display: flex;
    align-items: center;
}

.emerson-logo {
    height: 55px;
    width: auto;
    display: block;
    image-rendering: auto;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Prevent browser password save - text field that looks like password */
.password-masked {
    -webkit-text-security: disc;
    -moz-text-security: disc;
    text-security: disc;
}

.header-title {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.25rem;
    font-weight: 600;
    margin-left: auto;
}

.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.footer {
    padding: 1.5rem 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
}

.footer a {
    color: white;
    text-decoration: none;
    font-weight: 600;
}

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

.footer-links {
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.9);
}

.footer-links .divider {
    margin: 0 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

/* ============================================
   Card Component
   ============================================ */

.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 480px;
    padding: 2.5rem;
}

.card-icon {
    width: 64px;
    height: 64px;
    background: var(--emerson-purple);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.card-icon svg {
    width: 32px;
    height: 32px;
    fill: white;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 0.5rem;
}

.card-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 2rem;
}

.account-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--background-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--emerson-purple);
}

.account-banner svg {
    flex-shrink: 0;
    color: var(--emerson-purple);
}

/* ============================================
   Form Elements
   ============================================ */

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

.form-label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--emerson-purple);
    box-shadow: 0 0 0 3px rgba(98, 37, 157, 0.15);
}

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

.form-input.is-invalid {
    border-color: var(--error-red);
}

.form-input.is-valid {
    border-color: var(--success-green);
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.375rem;
}

.form-hint a {
    color: var(--emerson-purple);
    text-decoration: none;
}

.form-hint a:hover {
    text-decoration: underline;
}

.input-with-icon {
    position: relative;
}

.input-with-icon .form-input {
    padding-right: 3rem;
}

.input-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.25rem;
}

.input-toggle:hover {
    color: var(--text-secondary);
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--emerson-purple);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: var(--emerson-purple-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(98, 37, 157, 0.3);
}

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

.btn-primary:disabled {
    background: var(--warm-gray-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: white;
    color: var(--emerson-purple);
    border: 2px solid var(--emerson-purple);
    width: 100%;
}

.btn-secondary:hover {
    background: rgba(98, 37, 157, 0.05);
}

.btn-link {
    background: none;
    border: none;
    color: var(--emerson-purple);
    font-weight: 600;
    padding: 0.5rem;
    cursor: pointer;
}

.btn-link:hover {
    text-decoration: underline;
}

.btn-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* ============================================
   Option Cards (Landing Page)
   ============================================ */

.option-card {
    display: flex;
    align-items: center;
    padding: 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
    margin-bottom: 1rem;
}

.option-card:last-child {
    margin-bottom: 0;
}

.option-card:hover {
    border-color: var(--emerson-purple);
    background: rgba(98, 37, 157, 0.03);
    transform: translateX(4px);
}

.option-card-icon {
    width: 48px;
    height: 48px;
    background: var(--emerson-purple);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

.option-card-icon svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.option-card-icon.teal {
    background: var(--teal);
}

.option-card-icon.blue {
    background: var(--blue);
}

.option-card-content {
    flex: 1;
}

.option-card-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.option-card-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.option-card-arrow {
    color: var(--emerson-purple);
    margin-left: 0.5rem;
}

/* ============================================
   Alert Messages
   ============================================ */

.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #e7f3ff;
    color: #004085;
    border: 1px solid #b8daff;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* ============================================
   Password Requirements
   ============================================ */

.password-requirements {
    background: var(--background-light);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.password-requirements-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.requirement {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.25rem 0;
}

.requirement-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
}

.requirement.met .requirement-icon {
    background: var(--success-green);
    color: white;
}

.requirement.unmet .requirement-icon {
    background: #eee;
    color: var(--text-muted);
}

.requirement.met {
    color: var(--success-green);
}

/* ============================================
   Email Sent Confirmation
   ============================================ */

.email-sent {
    text-align: center;
    padding: 1rem 0;
}

.email-sent-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--teal), var(--blue));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.email-sent-icon svg {
    width: 40px;
    height: 40px;
    fill: white;
}

.email-sent-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.email-sent-message {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.email-sent-address {
    font-weight: 600;
    color: var(--emerson-purple);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.email-sent-note {
    font-size: 0.875rem;
    color: var(--text-muted);
    background: var(--background-light);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1.5rem;
}

/* ============================================
   Links
   ============================================ */

.text-link {
    color: var(--emerson-purple);
    text-decoration: none;
    font-weight: 600;
}

.text-link:hover {
    text-decoration: underline;
}

/* ============================================
   Duo Instructions Page
   ============================================ */

.instructions-content {
    text-align: left;
}

.instructions-content h2 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 1.5rem 0 0.75rem;
}

.instructions-content h2:first-child {
    margin-top: 0;
}

.instructions-content .scenario-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-style: italic;
    margin: 0 0 0.75rem;
}

/* Duo page accordions */
.duo-accordion {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.duo-accordion summary {
    padding: 0.875rem 1.125rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #fafafa;
    transition: background 0.15s ease;
}

.duo-accordion summary:hover {
    background: #f0f0f0;
}

.duo-accordion summary::-webkit-details-marker {
    display: none;
}

.duo-accordion summary::before {
    content: "";
    display: inline-block;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    transition: transform 0.2s ease;
}

.duo-accordion[open] summary::before {
    transform: rotate(90deg);
}

.duo-accordion[open] summary {
    border-bottom: 1px solid #e0e0e0;
}

.duo-accordion .accordion-body {
    padding: 1rem 1.125rem;
}

.duo-accordion .accordion-body ol {
    margin-left: 1.25rem;
    color: var(--text-secondary);
}

.duo-accordion .accordion-body li {
    margin-bottom: 0.5rem;
}

.instructions-content ol {
    margin-left: 1.25rem;
    color: var(--text-secondary);
}

.instructions-content li {
    margin-bottom: 0.5rem;
}

.instructions-content .note {
    background: #e7f3ff;
    border-left: 4px solid var(--blue);
    padding: 1rem;
    margin: 1rem 0;
    font-size: 0.9rem;
}

/* ============================================
   Loading Spinner
   ============================================ */

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.btn-loading {
    pointer-events: none;
    opacity: 0.85;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-loading .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

.btn-loading-text {
    /* keep the label visible next to the spinner */
}

/* ============================================
   Success Page
   ============================================ */

.success-icon {
    width: 80px;
    height: 80px;
    background: var(--success-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.success-icon svg {
    width: 40px;
    height: 40px;
    fill: white;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 480px) {
    .main-content {
        padding: 1rem;
        align-items: flex-start;
        padding-top: 1rem;
    }

    .card {
        padding: 1.5rem;
        border-radius: 8px;
    }

    .header {
        padding: 1rem;
    }

    .header-content {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .header-title {
        border-left: none;
        padding-left: 0;
        width: 100%;
        font-size: 0.9rem;
    }

    .emerson-logo {
        height: 32px;
    }

    .card-title {
        font-size: 1.25rem;
    }

    .option-card {
        padding: 1rem;
    }

    .option-card-icon {
        width: 40px;
        height: 40px;
    }
}
