/* Modern, Crisp & Compact UI Design for 快樂e學院 帳號註冊系統 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #0284c7;
    --primary-hover: #0369a1;
    --secondary-color: #64748b;
    --success-color: #0284c7;
    --bg-color: #f0f9ff;
    --card-bg: #ffffff;
    --text-primary: #0f172a;
    --text-muted: #64748b;
    --border-color: #cbd5e1;
    --border-radius: 4px;
    --control-height: 28px;
}

body {
    font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

/* Container width */
.form-card-container,
.header-container,
.footer-container {
    max-width: 620px;
    margin: 0 auto;
    width: 100%;
    padding: 0 15px;
}

.form-card-container {
    margin: 2rem auto;
}

.index-container {
    max-width: 920px;
    margin: 2rem auto;
    width: 100%;
    padding: 0 15px;
}

/* Header Navbar */
.app-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 0;
}

.brand-container {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    white-space: nowrap;
}

.brand-logo-img {
    height: 38px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1;
    white-space: nowrap;
}

.brand-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    margin-left: 4px;
}

/* Stepper Navigation */
.stepper-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    max-width: 480px;
    margin: 0 auto 1.75rem auto;
}

.stepper-wrapper::before {
    content: '';
    position: absolute;
    top: 16px;
    left: 25px;
    right: 25px;
    height: 2px;
    background: #cbd5e1;
    z-index: 1;
}

.stepper-step {
    position: relative;
    z-index: 2;
    background: white;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-muted);
    border: 2px solid #cbd5e1;
    transition: all 0.2s ease;
}

.stepper-step.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.18);
}

.stepper-step.completed {
    border-color: var(--success-color);
    background: var(--success-color);
    color: white;
}

.step-label {
    position: absolute;
    top: 36px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    color: var(--text-muted);
}

.stepper-step.active .step-label,
.stepper-step.completed .step-label {
    color: var(--text-primary);
}

/* Card Wrapper */
.main-card {
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}



.card-header-custom {
    background: #0284c7;
    color: white;
    padding: 1.25rem 1.5rem;
}

.card-header-custom h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.card-header-custom p {
    margin-top: 4px;
    font-size: 0.82rem;
    margin-bottom: 0;
    opacity: 0.9;
}

/* Horizontal Form Table-like Row */
.form-row {
    display: flex;
    align-items: center;
    margin-bottom: 1.1rem;
}

.form-row-label {
    width: 110px;
    min-width: 110px;
    text-align: right;
    padding-right: 12px;
    font-weight: 600;
    color: #334155;
    font-size: 0.9rem;
}

.form-row-content {
    flex: 1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 576px) {
    .form-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .form-row-label {
        width: 100% !important;
        min-width: 100% !important;
        text-align: left !important;
        padding-right: 0 !important;
        margin-bottom: 0.25rem;
    }
}

/* Compact Control Height (30px) */
.form-control, .form-select {
    border-radius: var(--border-radius) !important;
    padding: 2px 8px !important;
    border: 1px solid var(--border-color) !important;
    font-size: 0.85rem !important;
    color: #0f172a !important;
    height: var(--control-height) !important;
    line-height: 1.3 !important;
    box-shadow: none !important;
    background-color: #ffffff !important;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
}

/* Specific Input Width Constraints */
.input-idno {
    width: 240px !important;
    max-width: 100% !important;
}

.input-account {
    width: 240px !important;
    max-width: 100% !important;
}

.input-password {
    width: 240px !important;
    max-width: 100% !important;
}

/* Date Selector Group (Single Horizontal Line) */
.date-select-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.date-select-group .select-year {
    width: 175px !important;
}

.date-select-group .select-month,
.date-select-group .select-day {
    width: 65px !important;
}

.date-select-group span {
    font-weight: 500;
    color: #475569;
    font-size: 0.85rem;
}

/* Captcha Block (Single Horizontal Line) */
.captcha-block {
    display: flex;
    align-items: center;
    gap: 8px;
}

.captcha-svg-box {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: #ffffff;
    height: var(--control-height);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 1px 4px;
}

.captcha-svg-box svg {
    height: 32px;
    width: 100px;
}

.btn-captcha-refresh {
    height: var(--control-height);
    width: var(--control-height);
    padding: 0;
    font-size: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    background: #f8fafc;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.btn-captcha-refresh:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.captcha-input {
    width: 140px !important;
}

/* Prominent Centered Error Message Banner */
.form-error-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    text-align: center;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 3px rgba(220, 38, 38, 0.08);
}

.form-error-banner i {
    font-size: 1.05rem;
    color: #dc2626;
}

/* Right-aligned Button Area */
.form-actions-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 1rem;
    gap: 10px;
}

.form-actions-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    gap: 10px;
}

/* Standardized Buttons */
.btn-student-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 0 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    height: var(--control-height);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s ease;
    text-decoration: none;
    cursor: pointer;
}

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

/* Bootstrap Utility Overrides to Match Theme Primary */
.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.btn-primary:hover {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
}

.btn-student-secondary {
    background: #ffffff;
    color: #275a71;
    border: 1px solid #275a71;
    border-radius: var(--border-radius);
    padding: 0 1rem;
    font-weight: 600;
    font-size: 0.85rem;
    height: var(--control-height);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.15s ease;
    text-decoration: none;
    cursor: pointer;
}

.btn-student-secondary:hover {
    background: #f0f7f9;
    color: #1a3c4b;
    border-color: #1a3c4b;
}

/* Feature Cards on Index */
.feature-card {
    background: white;
    border-radius: 10px;
    padding: 1.25rem 1rem;
    text-align: center;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.feature-card:hover {
    transform: translateY(-2px);
    border-color: #818cf8;
    box-shadow: 0 6px 12px rgba(67, 56, 202, 0.08);
}

.feature-icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin: 0 auto 0.75rem auto;
}

.icon-blue { background: #e0f2fe; color: #0284c7; }
.icon-emerald { background: #ecfdf5; color: #059669; }
.icon-purple { background: #faf5ff; color: #9333ea; }
.icon-amber { background: #fffbeb; color: #d97706; }

/* Tables */
.table-custom {
    width: 100%;
    margin-bottom: 0;
    font-size: 0.9rem;
}

.table-custom th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    width: 30%;
    vertical-align: middle;
}

.table-custom td {
    vertical-align: middle;
}

/* Footer */
.app-footer {
    margin-top: auto;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding: 0.85rem 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}