/* Internet2 Identity Enrollment - Components */

/* Buttons */
.btn {
    background: var(--primary-blue);
    color: var(--white);
    padding: 0.875rem 2rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-width: 120px;
    position: relative;
    overflow: hidden;
}

/* Subtle button shimmer effect on hover */
.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    background: var(--secondary-blue);
    box-shadow: 0 0 0 1px var(--white) inset, 0 4px 15px rgba(var(--secondary-blue-rgb), 0.4);
    text-decoration: none;
    color: var(--white);
}

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

.btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn:disabled::before {
    display: none;
}

.btn.full-width {
    width: 100%;
    display: block;
}

.btn-secondary {
    background: #5a6268;
    color: var(--white);
}

.btn-secondary:hover {
    background: #454b50;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.btn-outline {
    background: transparent;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

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

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    min-width: 100px;
}

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    min-width: 150px;
    border-radius: var(--radius-md);
    font-weight: 600;
}

.btn-large:hover {
    box-shadow: 0 6px 20px rgba(var(--secondary-blue-rgb), 0.4);
}

/* Cards */
.card {
    background: var(--white);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: var(--primary-blue);
    box-shadow: 0 4px 15px rgba(var(--primary-blue-rgb), 0.15);
    transform: translateY(-2px);
}

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

.card p {
    color: var(--text-body);
    margin-bottom: 1rem;
}

/* Action Cards Grid */
.action-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Grid already stretches cards in the same row to equal height, but a
   card's button still lands wherever the preceding text happens to end.
   A longer/wrapping heading or description pushes its button down
   relative to a neighboring card with shorter text. Making the card a
   flex column and pinning the button to the bottom with margin-top:auto
   keeps buttons aligned across a row regardless of how much the text
   above them wraps. */
.action-cards .card {
    display: flex;
    flex-direction: column;
}

.action-cards .card .btn {
    margin-top: auto;
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    text-align: center;
}

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

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-heading);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    /* No `outline: none` -- that overrode the visible 3px focus ring in
       base.css `input:focus-visible` (WCAG 2.4.7). The border + shadow below
       are visual enhancement on top of that ring. */
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(var(--primary-blue-rgb), 0.15);
}

.form-control.error {
    border-color: #ef4444;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.form-help {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Email verification hint (detail page). The leading glyph (info / check) and
   the wording carry the meaning, so the state never depends on color alone
   (WCAG 1.4.1). The verified color is chosen to clear 4.5:1 on white (1.4.3). */
.email-verify-hint {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.email-verify-hint .email-verify-icon {
    font-weight: 700;
    flex-shrink: 0;
}

.email-verify-hint.is-verified {
    color: #146c43; /* ~5.9:1 on white */
}

.form-error {
    font-size: 0.875rem;
    color: #b91c1c;
    margin-top: 0.25rem;
}

/* Messages */
.message {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-weight: 500;
    text-align: center;
}

.message.error {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error-text);
}

.message.error ul {
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: left;
}

.message.error li {
    margin-bottom: 0.5rem;
}

.message.error li:last-child {
    margin-bottom: 0;
}

.message.success {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success-heading);
}

.message.info {
    background: var(--tint-blue-bg);
    border: 1px solid var(--tint-blue-border);
    color: var(--secondary-blue);
}

.message.warning {
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    color: var(--warning-text);
}

/* Features Grid */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.feature {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s ease;
}

.feature-icon {
    background: var(--primary-blue);
    color: var(--white);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.feature-content h4 {
    color: var(--text-heading);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.feature-content p {
    color: var(--text-body);
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* Combined panel: the feature grid plus a divided Security & Privacy footer.
   Reuses the security-notice color pairing (already contrast-checked). */
.features-card {
    background: var(--tint-blue-bg);
    border: 1px solid var(--tint-blue-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
    margin: 2rem 0;
}

.features-card .features {
    /* The card supplies the outer spacing now. */
    margin: 0;
}

.features-security-note {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--tint-blue-border);
    text-align: center;
    font-size: 0.9rem;
}

.features-security-note h3 {
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

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

/* Footer */
.footer {
    background: #f8f9fa;
    border-top: 1px solid var(--border-light);
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer a {
    color: var(--primary-blue);
}

.footer p {
    margin: 0;
    color: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 768px) {
    .action-cards {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .card {
        padding: 1rem;
    }

    .features {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

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

    .btn {
        width: 100%;
    }

    .btn-large {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }
}
