/* Internet2 Identity Enrollment - Page-specific Styles */

/* Terms Page Specific */
.terms-intro {
    background: var(--tint-blue-bg);
    border: 1px solid var(--tint-blue-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.terms-intro h4 {
    color: var(--primary-blue);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.terms-intro p {
    color: var(--secondary-blue);
    margin: 0.5rem 0;
    font-size: 0.95rem;
}

.terms-list {
    background: #f8f9fa;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.terms-item {
    background: var(--white);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.terms-item:last-child {
    margin-bottom: 0;
}

.terms-item.checked {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(var(--primary-blue-rgb), 0.1);
}

.terms-item-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.terms-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 1rem;
    margin-top: 0.2rem;
    cursor: pointer;
    accent-color: var(--primary-blue);
}

.terms-content {
    flex: 1;
}

.terms-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.terms-title-link {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    flex: 1;
}

.terms-title-link:hover {
    color: var(--secondary-blue);
    text-decoration: underline;
}

.terms-inline-link {
    color: var(--primary-blue);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--primary-blue);
    border-radius: 4px;
    background: var(--white);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.terms-inline-link:hover {
    background: var(--primary-blue);
    color: var(--white);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(var(--primary-blue-rgb), 0.3);
}

.terms-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.terms-item.checked .terms-title-link {
    color: var(--success-text);
}

.terms-item.checked .terms-inline-link {
    border-color: var(--success-text);
    color: var(--success-text);
}

.terms-item.checked .terms-inline-link:hover {
    background: var(--success-text);
    color: var(--white);
}

.agreement-summary {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.agreement-summary h4 {
    color: var(--success-heading);
    margin-bottom: 0.5rem;
}

.agreement-summary p {
    color: var(--success-text);
    margin: 0;
    font-size: 0.9rem;
}

.agreement-count {
    font-weight: bold;
    color: var(--primary-blue);
}

.select-all-section {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: var(--radius-md);
}

.select-all-btn {
    background: none;
    border: 1px solid var(--primary-blue);
    color: var(--primary-blue);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.select-all-btn:hover {
    background: var(--primary-blue);
    color: var(--white);
}

.terms-section {
    margin-bottom: 2rem;
}

.terms-section h3 {
    color: var(--text-heading);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    font-weight: 600;
    text-align: center;
}

/* Confirmation Page Specific */

/* The confirmation page only celebrates once the directory has confirmed the
   account exists. Everything that claims success is tagged .ldap-when-verified
   and stays hidden until <body data-ldap-state> flips out of "pending". */
.ldap-when-pending,
.ldap-when-verified,
.ldap-when-failed {
    display: none;
}

[data-ldap-state="pending"] .ldap-when-pending,
[data-ldap-state="verified"] .ldap-when-verified,
[data-ldap-state="failed"] .ldap-when-failed {
    display: block;
}

.ldap-checking {
    text-align: center;
    padding: 2rem 1rem 2.5rem;
}

/* Also defined by main.js, but the spinner must animate before that loads. */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ldap-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 1.5rem;
    border: 4px solid var(--border-light);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.ldap-checking-text {
    color: var(--text-heading);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.ldap-checking-hint {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.ldap-error-detail:empty {
    display: none;
}

.ldap-error-detail {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--error-text);
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: successPulse 2s ease-in-out infinite;
}

@keyframes successPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.progress-complete {
    text-align: center;
    margin-bottom: 2rem;
}

.progress-text {
    color: var(--success-text);
    font-size: 1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.progress-complete .progress-bar {
    background: var(--border-light);
    height: 6px;
    border-radius: 3px;
    max-width: 300px;
    margin: 0 auto;
    overflow: hidden;
}

.progress-complete .progress-fill {
    background: var(--success-text);
    height: 100%;
    width: 100%;
    border-radius: 3px;
    animation: progressComplete 2s ease-out;
}

@keyframes progressComplete {
    0% { width: 75%; }
    100% { width: 100%; }
}

.completion-message {
    text-align: center;
    margin-bottom: 3rem;
}

.completion-message h2 {
    color: var(--text-heading);
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.completion-message p {
    color: var(--text-body);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    line-height: 1.7;
}

.success-details {
    background: var(--tint-blue-bg);
    border: 1px solid var(--tint-blue-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
}

.success-details h2,
.success-details h3 {
    color: var(--primary-blue);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.success-details ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.success-details li {
    color: var(--secondary-blue);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.success-details li::before {
    content: '\2713';
    color: var(--success-text);
    font-weight: bold;
    font-size: 1.1rem;
}


.redirect-section {
    text-align: center;
    background: var(--tint-blue-bg);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
}

.redirect-section h2,
.redirect-section h3 {
    color: var(--primary-blue);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.redirect-section p {
    color: var(--secondary-blue);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.redirect-url {
    background: var(--white);
    border: 1px solid var(--tint-blue-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1.5rem;
    word-break: break-all;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--primary-blue);
}

.alternative-action {
    text-align: center;
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    border-radius: var(--radius-lg);
}

.alternative-action h2,
.alternative-action h4 {
    color: var(--warning-text);
    margin-bottom: 0.5rem;
}

.alternative-action p {
    color: var(--warning-text);
    margin: 0;
    font-size: 0.95rem;
}

.celebration-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--primary-blue);
    animation: confetti-fall 3s linear infinite;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Email Confirmation / Verification Page */
.verification-section {
    text-align: center;
    padding: 2rem;
    background: var(--tint-blue-bg);
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

.email-icon {
    font-size: 2.5rem;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

.verification-section h3 {
    color: var(--text-heading);
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.verification-section p {
    color: var(--text-body);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

/* Security/troubleshooting note folded into the Check Your Email card
   (was the separate bottom "Security Notice" card). Same color pairing the
   old card used, set off by a divider. */
.verification-note {
    margin: 0;
    padding-top: 1rem;
    border-top: 1px solid var(--tint-blue-border);
    color: var(--secondary-blue);
    font-size: 0.9rem;
}

.form-section {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

.verification-code-input {
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
    padding: 1rem;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    letter-spacing: 0.5rem;
    font-family: 'Courier New', monospace;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    display: block;
}

/* Center the PIN field's label and help text so they align with the
   centered .verification-code-input between them (shared by the enroll
   email-verify and self-service email-change PIN pages). */
.verification-code-group {
    text-align: center;
}

.verification-code-input:focus {
    /* No `outline: none` -- keep the visible focus ring (WCAG 2.4.7). */
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(var(--primary-blue-rgb), 0.15);
}

.verification-code-input::placeholder {
    color: #5a677a; /* ~5.5:1 on white (was #8895a7 ~3:1) -- WCAG 1.4.3 */
    letter-spacing: 0.2rem;
}

.resend-section {
    text-align: center;
    padding: 1rem;
    border-top: 1px solid var(--border-light);
    margin-top: 1rem;
}

.resend-section p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.resend-btn {
    background: none;
    border: 1px solid var(--primary-blue);
    color: var(--primary-blue);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.resend-btn:hover {
    background: var(--primary-blue);
    color: var(--white);
}

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

.timer {
    color: #b91c1c;
    font-weight: bold;
}

/* Detail/Enrollment Page Specific */
.form-section h2,
.form-section h3 {
    color: var(--text-heading);
    margin-bottom: 1.5rem;
    font-weight: 600;
    font-size: 1.3rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-col {
    flex: 1;
}

.required {
    color: #b91c1c;
}

.optional-fields {
    border-top: 1px solid var(--border-light);
    padding-top: 1.5rem;
    margin-top: 1.5rem;
}

.optional-fields h4 {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-optional {
    background: none;
    border: none;
    color: var(--primary-blue);
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.toggle-optional:hover {
    color: var(--secondary-blue);
}

/* Home Page Specific */
.welcome-section {
    text-align: center;
    margin-bottom: 3rem;
}

.welcome-section h2 {
    color: var(--text-heading);
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.welcome-section p {
    color: var(--text-body);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Home page specific progress indicator */
.progress-indicator {
    text-align: center;
    margin-bottom: 2rem;
}

.progress-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.progress-bar {
    background: var(--border-light);
    height: 4px;
    border-radius: 2px;
    max-width: 200px;
    margin: 0 auto;
    overflow: hidden;
}

/* Home page registration steps */
.steps {
    background: #f8f9fa;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin: 2rem 0;
}

.steps h3 {
    color: var(--text-heading);
    margin-bottom: 1rem;
    text-align: center;
}

.step-list {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.step {
    text-align: center;
    flex: 1;
    min-width: 150px;
    opacity: 1;
    transform: scale(1);
}

.step-number {
    background: var(--primary-blue);
    color: var(--white);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    font-weight: bold;
}

.step-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 0.25rem;
}

/* "if needed" marker on the conditional Email Verification step. Dark blue on
   a light-blue pill (~7:1 contrast, WCAG AA/AAA). */
.step-optional-tag {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.05rem 0.4rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #155470;
    background: #e1effa;
    border-radius: 999px;
    vertical-align: middle;
    white-space: nowrap;
}

.step-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Home page action section */
.action-section {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid var(--border-light);
    margin-top: 2rem;
}

.action-section p {
    font-size: 1.1rem;
    color: var(--text-body);
    margin-bottom: 1.5rem;
}

/* Home page contact info */
.contact-info {
    background: var(--tint-blue-bg);
    border: 1px solid var(--tint-blue-border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-top: 2rem;
    text-align: center;
}

.contact-info p {
    color: var(--secondary-blue);
    margin: 0;
}

.contact-info a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
}

.contact-info a:hover {
    text-decoration: underline;
}

/* Home page responsive design */
@media (max-width: 768px) {
    .step-list {
        flex-direction: column;
        gap: 1.5rem;
    }

    .step {
        min-width: auto;
    }

    /* Detail page responsive */
    .form-row {
        flex-direction: column;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn-secondary {
        width: 100%;
        margin-right: 0;
    }

    /* Email verification responsive */
    .verification-code-input {
        font-size: 1.2rem;
        max-width: 180px;
        letter-spacing: 0.3rem;
    }

    .form-section {
        padding: 1.5rem;
    }

    /* Confirmation page responsive */
    .success-details,
    .next-steps,
    .redirect-section {
        padding: 1.5rem;
    }

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

/* Security Notice */
.security-notice {
    background: var(--tint-blue-bg);
    border: 1px solid var(--tint-blue-border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-top: 2rem;
    font-size: 0.9rem;
    text-align: center;
}

.security-notice h2,
.security-notice h3,
.security-notice h4 {
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.security-notice p {
    color: var(--secondary-blue);
    margin: 0;
}

/* SSO Check Page Specific */
.attr-check-list {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
    background: #f8f9fa;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.attr-check-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
}

.attr-check-list li:last-child {
    border-bottom: none;
}

.attr-check-label {
    font-weight: 600;
    color: var(--text-heading);
}

.attr-check-status {
    font-weight: 500;
}

.attr-check-value {
    font-weight: 400;
    color: var(--text-muted);
}

.attr-check-list li.ok .attr-check-status {
    color: var(--success-text);
}

.attr-check-list li.ok .attr-check-status::before {
    content: '\2713';
    margin-right: 0.4rem;
    font-weight: bold;
}

.attr-check-list li.fail .attr-check-status {
    color: var(--error-text);
}

.attr-check-list li.fail .attr-check-status::before {
    content: '\2715';
    margin-right: 0.4rem;
    font-weight: bold;
}

.attr-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0 1.5rem;
    font-size: 0.9rem;
}

.attr-table th,
.attr-table td {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.attr-table th {
    background: var(--tint-blue-bg);
    color: var(--primary-blue);
    font-weight: 600;
}

.attr-table code {
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    color: var(--secondary-blue);
}

@media (max-width: 480px) {
    .attr-table {
        font-size: 0.8rem;
    }

    .attr-check-list li {
        flex-direction: column;
        align-items: flex-start;
    }
}


/* Responsive Design for Pages */
@media (max-width: 768px) {
    .terms-item {
        padding: 1rem;
    }

    .terms-item-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .terms-checkbox {
        margin-bottom: 0.5rem;
        margin-right: 0;
    }

    .terms-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .terms-inline-link {
        align-self: flex-start;
    }

    .verification-code-input {
        font-size: 1.2rem;
        max-width: 180px;
    }

    .welcome-section p {
        font-size: 1rem;
    }
}
