/* SiteU Student Portal – Public portal styles
 *
 * Colours are defined as CSS custom properties on .sdp-portal.
 * Any theme can override them without touching this file:
 *
 *   .sdp-portal {
 *     --sdp-accent : #14B8A6;
 *     --sdp-heading: #1E293B;
 *   }
 */

/* ---- Design tokens (neutral defaults, work on any site) ---- */
.sdp-portal {
    --sdp-accent      : #5cb85c;
    --sdp-accent-hover: #4cae4c;
    --sdp-accent-ring : rgba(37,99,235,.12);
    --sdp-heading     : #111827;
    --sdp-text        : #374151;
    --sdp-muted       : #6B7280;
    --sdp-subtle      : #9CA3AF;
    --sdp-border      : #D1D5DB;
    --sdp-bg          : #FFFFFF;
    --sdp-bg-subtle   : #F9FAFB;
    --sdp-radius-card : 10px;
    --sdp-radius-input: 7px;
}

/* ---- Wrapper ---- */
.sdp-portal {
    max-width: 480px;
    margin: 0 auto;
    font-family: inherit;
}

/* ---- Notice variants (error/blocked/closed pages) ---- */
.sdp-notice {
    background: var(--sdp-bg);
    border-radius: var(--sdp-radius-card);
    padding: 32px;
    text-align: center;
    border: 1px solid var(--sdp-border);
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.sdp-notice h2  { margin: 12px 0 8px; font-size: 20px; }
.sdp-notice p   { margin: 0 0 8px; color: var(--sdp-muted); }
.sdp-notice .sdp-help { font-size: 13px; color: var(--sdp-subtle); }

.sdp-icon {
    width: 48px; height: 48px;
    display: block;
    margin: 0 auto 8px;
}
.sdp-notice--error   .sdp-icon { color: #dc2626; }
.sdp-notice--error   h2        { color: #dc2626; }
.sdp-notice--warning .sdp-icon { color: #d97706; }
.sdp-notice--warning h2        { color: #92400e; }
.sdp-notice--info    h2        { color: var(--sdp-heading); }

/* ---- Form header ---- */
.sdp-form-header {
    text-align: center;
    margin-bottom: 20px;
}
.sdp-form-icon {
    width: 44px; height: 44px;
    color: var(--sdp-accent);
    display: block;
    margin: 0 auto 10px;
}
.sdp-form-header h2 { margin: 0 0 4px; font-size: 22px; color: var(--sdp-heading); }
.sdp-form-header p  { margin: 0; color: var(--sdp-muted); font-size: 15px; }

/* ---- Form card ---- */
.sdp-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    background: var(--sdp-bg);
    border-radius: var(--sdp-radius-card);
    padding: 28px;
    border: 1px solid var(--sdp-border);
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

/* ---- Fields ---- */
.sdp-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sdp-field label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 14px;
    color: var(--sdp-heading);
}

.sdp-field input[type="text"],
.sdp-field input[type="number"],
.sdp-field input[type="email"],
.sdp-field select {
    padding: 10px 14px;
    border: 1.5px solid var(--sdp-border);
    border-radius: var(--sdp-radius-input);
    font-size: 15px;
    font-family: inherit;
    color: var(--sdp-heading);
    transition: border-color .15s, box-shadow .15s;
    width: 100%;
    box-sizing: border-box;
    background: var(--sdp-bg);
}

.sdp-field select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

.sdp-field input::placeholder { color: var(--sdp-subtle); }

.sdp-field input:focus,
.sdp-field select:focus {
    outline: none;
    border-color: var(--sdp-accent);
    box-shadow: 0 0 0 3px var(--sdp-accent-ring);
}

/* ---- Help icon tooltip ---- */
.sdp-help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--sdp-border);
    color: var(--sdp-muted);
    font-size: 10px;
    font-weight: 700;
    cursor: default;
    position: relative;
    flex-shrink: 0;
    line-height: 1;
}

.sdp-help-icon::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--sdp-heading);
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    padding: 7px 11px;
    border-radius: 6px;
    white-space: normal;
    max-width: 240px;
    text-align: left;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s;
    z-index: 10;
}
.sdp-help-icon:hover::after,
.sdp-help-icon:focus::after { opacity: 1; }

/* ---- Inline alert ---- */
.sdp-alert {
    border-radius: var(--sdp-radius-input);
    padding: 12px 16px;
    font-size: 14px;
    margin-bottom: 4px;
}
.sdp-alert--error   { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.sdp-alert--warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.sdp-alert--info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ---- Submit button (matches Enfold .avia-button style) ---- */
.sdp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 30px 13px;
    border: none;
    border-bottom: 1px solid rgba(0,0,0,.2);
    border-radius: 3px;
    font-size: 13px;
    font-weight: 400;
    font-family: inherit;
    cursor: pointer;
    line-height: 1.2em;
    transition: opacity .4s ease-in-out;
    text-decoration: none;
}
.sdp-btn--primary        { background: var(--sdp-accent); color: #fff; }
.sdp-btn--primary:hover  { opacity: .9; background: var(--sdp-accent); color: #fff; }
.sdp-btn--primary:active {
    border-bottom-width: 0;
    border-top: 1px solid rgba(0,0,0,.2);
}
.sdp-btn-icon { width: 18px; height: 18px; }

/* ---- Privacy note ---- */
.sdp-privacy-note {
    font-size: 11px;
    color: var(--sdp-subtle);
    text-align: center;
    margin: 10px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

/* ---- Success / download state ---- */
.sdp-success-header {
    text-align: center;
    padding: 28px 20px 20px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--sdp-radius-card) var(--sdp-radius-card) 0 0;
}
.sdp-check-icon {
    width: 48px; height: 48px;
    color: #16a34a;
    display: block;
    margin: 0 auto 12px;
}
.sdp-success-header h2 { margin: 0 0 6px; font-size: 22px; color: #15803d; }
.sdp-success-header p  { margin: 0; color: #166534; font-size: 15px; }

/* ---- Email sent confirmation ---- */
.sdp-email-display {
    margin-top: 10px !important;
    font-size: 14px;
    color: #14532d !important;
    background: #fff;
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid #bbf7d0;
}
.sdp-instructions {
    padding: 24px;
    background: var(--sdp-bg);
    border: 1px solid #bbf7d0;
    border-top: none;
    border-radius: 0 0 var(--sdp-radius-card) var(--sdp-radius-card);
}
.sdp-steps {
    margin: 0 0 20px;
    padding-left: 22px;
    color: var(--sdp-text);
    font-size: 14px;
    line-height: 1.7;
}
.sdp-steps li { margin-bottom: 4px; }
.sdp-steps em  { color: var(--sdp-accent); font-style: normal; font-weight: 600; }

/* ---- Download buttons ---- */
.sdp-download-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    background: var(--sdp-bg);
    border: 1px solid #bbf7d0;
    border-top: none;
}

.sdp-download-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 20px 13px;
    background: var(--sdp-accent);
    color: #fff;
    border-radius: 3px;
    border: none;
    border-bottom: 1px solid rgba(0,0,0,.2);
    text-decoration: none;
    font-weight: 400;
    font-size: 13px;
    line-height: 1.2em;
    transition: opacity .4s ease-in-out;
}
.sdp-download-btn:hover  { opacity: .9; background: var(--sdp-accent); color: #fff; text-decoration: none; }

/* The button is an <a>, so a theme's link colour outranks the rule above and
 * paints the label in its own blue. Scoping to .sdp-portal and naming the
 * element and the link states puts us ahead of that without !important, and
 * the descendant rule keeps the label inside the span from being coloured
 * separately. */
.sdp-portal a.sdp-download-btn,
.sdp-portal a.sdp-download-btn:link,
.sdp-portal a.sdp-download-btn:visited,
.sdp-portal a.sdp-download-btn:hover,
.sdp-portal a.sdp-download-btn:focus,
.sdp-portal a.sdp-download-btn:active {
    color: #fff;
    text-decoration: none;
}
.sdp-portal a.sdp-download-btn * { color: inherit; }
.sdp-download-btn:active {
    border-bottom-width: 0;
    border-top: 1px solid rgba(0,0,0,.2);
}
.sdp-download-btn__icon svg { width: 22px; height: 22px; flex-shrink: 0; }
.sdp-download-btn__text { display: flex; flex-direction: column; }

/* ---- Token info bar ---- */
.sdp-token-info {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    color: var(--sdp-muted);
    padding: 12px 14px;
    background: var(--sdp-bg-subtle);
    border: 1px solid var(--sdp-border);
    border-radius: 6px;
}
.sdp-download-list + .sdp-token-info {
    border-top: none;
    border-radius: 0 0 var(--sdp-radius-card) var(--sdp-radius-card);
    padding: 12px 20px;
}
.sdp-instructions .sdp-token-info { margin-top: 4px; }

@media (max-width: 600px) {
    .sdp-form   { padding: 20px; }
    .sdp-notice { padding: 24px 16px; }
    .sdp-help-icon::after { max-width: 200px; }
}
