/* =========================================================
   尚儀教育有聲雲｜我的書房登入／註冊 UI 第一輪
   僅調整 studyLogin.aspx、studyRegister.aspx 視覺與 RWD。
   不變更帳號、驗證碼、忘記密碼及註冊 AJAX 邏輯。
   ========================================================= */
:root {
    --auth-blue: #0b3b66;
    --auth-blue-dark: #062c50;
    --auth-orange: #f39a21;
    --auth-orange-dark: #dc7d08;
    --auth-ink: #21364c;
    --auth-muted: #65778a;
    --auth-line: #dce6ef;
    --auth-soft: #eef4f8;
    --auth-bg: #f4f7fa;
    --auth-white: #ffffff;
    --auth-shadow: 0 20px 52px rgba(17, 47, 78, .12);
}

.sy-study-auth-body,
.sy-study-auth-body * {
    box-sizing: border-box;
}

.sy-study-auth-body {
    color: var(--auth-ink);
    font-family: "Noto Sans TC", "Microsoft JhengHei", Arial, sans-serif;
}

.sy-auth-eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 6px;
    color: var(--auth-orange-dark);
    font-size: 12px;
    line-height: 1.4;
    font-weight: 950;
    letter-spacing: .12em;
}

/* ---------- 登入／忘記密碼（支援 Colorbox iframe） ---------- */
body.sy-study-login-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 90% 10%, rgba(243, 154, 33, .16), transparent 28%),
        linear-gradient(160deg, #fff9f0 0%, #f2f7fb 65%, #ffffff 100%) !important;
}

.sy-study-login-body #form1 {
    width: 100%;
    max-width: 600px !important;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.sy-study-login-body #form1 > .sy-study-login-shell {
    width: 100%;
    max-width: 540px !important;
    margin: 0 auto !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.sy-auth-card {
    width: 100%;
    padding: 26px !important;
    border: 1px solid var(--auth-line) !important;
    border-radius: 24px !important;
    background: rgba(255, 255, 255, .97) !important;
    box-shadow: var(--auth-shadow) !important;
}

.sy-auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.sy-auth-icon {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 17px;
    color: #fff;
    background: linear-gradient(135deg, var(--auth-blue), var(--auth-blue-dark));
    box-shadow: 0 10px 22px rgba(11, 59, 102, .22);
    font-size: 21px;
}

.sy-auth-brand h1 {
    margin: 0;
    color: var(--auth-blue-dark);
    font-size: 27px;
    line-height: 1.25;
    font-weight: 950;
}

.sy-auth-brand > div > p:last-child {
    margin: 5px 0 0;
    color: var(--auth-muted);
    font-size: 14px;
    line-height: 1.55;
}

#studyLogin .sy-auth-note {
    margin: 0 0 16px !important;
    padding: 13px 15px !important;
    border: 1px solid #f0d6b2 !important;
    border-radius: 15px !important;
    background: #fff8ed !important;
}

#studyLogin .sy-auth-note h4 {
    margin: 0 0 5px !important;
    color: #5f4a2f !important;
    font-size: 13px !important;
    line-height: 1.6 !important;
}

#studyLogin .sy-auth-note h4:last-child { margin-bottom: 0 !important; }

.sy-auth-register-link {
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 20px;
    padding: 10px 14px;
    border: 1px solid #cbdceb;
    border-radius: 14px;
    color: var(--auth-blue) !important;
    background: var(--auth-soft);
    font-size: 14px;
    font-weight: 900;
    text-decoration: none !important;
}

.sy-auth-register-link .fa-arrow-right { margin-left: auto; }
.sy-auth-register-link:hover,
.sy-auth-register-link:focus { color: #fff !important; background: var(--auth-blue); border-color: var(--auth-blue); }

#studyLogin .sy-auth-form-title {
    margin: 0 0 12px !important;
    color: var(--auth-blue-dark) !important;
    font-size: 20px !important;
    font-weight: 950 !important;
}

.sy-auth-label {
    display: block;
    margin: 0 0 6px;
    color: var(--auth-blue-dark);
    font-size: 13px;
    font-weight: 900;
}

#studyLogin .login-input,
#forgetPsw .login-input { margin: 12px 0 !important; }

#studyLogin input.text,
#forgetPsw input.text {
    width: 100% !important;
    height: 48px !important;
    min-height: 48px !important;
    max-height: none !important;
    padding: 0 14px !important;
    border: 1px solid #cbd8e5 !important;
    border-radius: 12px !important;
    color: var(--auth-ink) !important;
    background: #fff !important;
    font-size: 15px !important;
    outline: 0;
    box-shadow: none !important;
}

#studyLogin input.text:focus,
#forgetPsw input.text:focus {
    border-color: var(--auth-blue) !important;
    box-shadow: 0 0 0 3px rgba(11, 59, 102, .10) !important;
}

.sy-auth-captcha-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px;
    align-items: center;
}

#studyLogin #txtSafeCode { width: 100% !important; }

#studyLogin #btnRefreshSafeCode {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid #cbd8e5;
    border-radius: 12px;
    background: #fff;
    color: var(--auth-blue);
    text-decoration: none;
}

#studyLogin #imgSafeCode {
    width: 90px !important;
    height: 30px !important;
    margin: 0 !important;
    border: 0 !important;
}

.sy-auth-options {
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 8px;
}

.sy-auth-options .floatL,
.sy-auth-options .floatR { float: none !important; margin: 0 !important; }
.sy-auth-options a { color: var(--auth-blue) !important; font-weight: 800; text-decoration: none; }

#studyLogin .btn-block,
#forgetPsw .btn-block,
.sy-auth-primary,
.sy-auth-secondary {
    min-height: 48px !important;
    height: auto !important;
    line-height: 1.3 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px !important;
    border-radius: 14px !important;
    font-family: inherit;
    font-size: 15px !important;
    font-weight: 950 !important;
    text-decoration: none !important;
    cursor: pointer;
}

.sy-auth-primary {
    border: 1px solid var(--auth-orange) !important;
    color: #fff !important;
    background: linear-gradient(135deg, var(--auth-orange), var(--auth-orange-dark)) !important;
    box-shadow: 0 10px 22px rgba(243, 154, 33, .24) !important;
}

.sy-auth-primary:hover,
.sy-auth-primary:focus { color: #fff !important; transform: translateY(-1px); }

.sy-auth-secondary {
    border: 1px solid #cbd8e5 !important;
    color: var(--auth-blue) !important;
    background: #fff !important;
    box-shadow: none !important;
}

.sy-auth-secondary:hover,
.sy-auth-secondary:focus { color: #fff !important; background: var(--auth-blue) !important; border-color: var(--auth-blue) !important; }

.sy-forgot-card h2 { display: none; }
.sy-auth-brand-compact { margin-bottom: 8px; }

/* ---------- 註冊頁 ---------- */
body.sy-study-register-body {
    background: var(--auth-bg);
}

.sy-register-page {
    width: min(1080px, calc(100% - 40px));
    margin: 0 auto;
    padding: 30px 0 54px !important;
}

.sy-register-hero {
    min-height: 155px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 22px;
    padding: 28px 34px;
    border-radius: 28px;
    color: #fff;
    background:
        radial-gradient(circle at 90% 15%, rgba(255,255,255,.16), transparent 28%),
        linear-gradient(135deg, var(--auth-blue-dark), #174f7e);
    box-shadow: var(--auth-shadow);
}

.sy-register-hero h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(30px, 4vw, 42px);
    font-weight: 950;
}

.sy-register-hero > div > p:last-child {
    margin: 9px 0 0;
    color: rgba(255,255,255,.88);
    font-size: 16px;
}

.sy-register-hero .sy-auth-eyebrow { color: #ffd8a4; }

.sy-register-login-link {
    min-height: 46px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 999px;
    color: #fff !important;
    background: rgba(255,255,255,.10);
    font-weight: 900;
    text-decoration: none !important;
}

.sy-register-login-link:hover { background: #fff; color: var(--auth-blue) !important; }

.sy-register-card {
    padding: 26px;
    border: 1px solid var(--auth-line);
    border-radius: 28px;
    background: #fff;
    box-shadow: var(--auth-shadow);
}

.sy-register-card .step.step-round {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 24px !important;
    padding: 7px !important;
    border-radius: 20px;
    background: var(--auth-soft);
}

.sy-register-card .step.step-round li {
    float: none !important;
    width: auto !important;
    margin: 0 !important;
}

.sy-register-card .step.step-round li p {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 !important;
    padding: 8px 12px;
    border-radius: 14px;
    color: var(--auth-muted);
    background: transparent;
    font-weight: 900;
}

.sy-register-card .step.step-round li p strong {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--auth-blue);
    background: #fff;
    font-size: 13px;
}

.sy-register-card .step.step-round li.active p {
    color: #fff;
    background: linear-gradient(135deg, var(--auth-blue), var(--auth-blue-dark));
    box-shadow: 0 8px 18px rgba(11,59,102,.18);
}

.sy-register-card .step.step-round li.active p strong { color: var(--auth-orange-dark); }

.sy-register-card .carousel-inner.padding { padding: 0 !important; }

.sy-register-step {
    min-height: 390px;
    padding: 8px 6px 4px;
}

.sy-register-step-head {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--auth-line);
}

.sy-register-step-head > span {
    color: var(--auth-orange-dark);
    font-size: 12px;
    font-weight: 950;
    letter-spacing: .12em;
}

.sy-register-step-head h2 {
    margin: 4px 0 5px;
    color: var(--auth-blue-dark);
    font-size: 25px;
    font-weight: 950;
}

.sy-register-step-head p {
    margin: 0;
    color: var(--auth-muted);
    font-size: 14px;
}

.sy-register-step-head em { color: #bd2f25; font-style: normal; }

.sy-register-field {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    align-items: start;
    gap: 8px 16px;
    margin-bottom: 17px;
}

.sy-register-field label {
    min-height: 48px;
    display: flex;
    align-items: center;
    margin: 0;
    color: var(--auth-blue-dark);
    font-size: 15px;
    font-weight: 900;
}

.sy-register-field input[type="text"],
.sy-register-field input[type="password"] {
    width: 100% !important;
    height: 48px;
    min-height: 48px;
    padding: 0 14px !important;
    border: 1px solid #cbd8e5 !important;
    border-radius: 12px;
    color: var(--auth-ink);
    background: #fff;
    font-size: 15px !important;
    outline: 0;
}

.sy-register-field input:focus {
    border-color: var(--auth-blue) !important;
    box-shadow: 0 0 0 3px rgba(11,59,102,.10);
}

.sy-register-field h4 {
    grid-column: 2;
    width: auto !important;
    float: none !important;
    margin: -3px 0 0 !important;
    color: var(--auth-muted);
    font-size: 13px;
    line-height: 1.5;
}

.sy-register-captcha {
    grid-template-columns: 160px minmax(150px, 1fr) auto;
}

.sy-register-captcha > a {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid #cbd8e5;
    border-radius: 12px;
    color: var(--auth-blue);
    background: #fff;
    text-decoration: none;
    cursor: pointer;
}

.sy-register-captcha img { width: 90px !important; height: 30px !important; border: 0; }

.sy-register-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 22px;
}

.sy-register-actions > h4,
.sy-register-actions > .sy-privacy-check {
    flex: 0 0 100%;
}

.sy-register-actions .btn-default { min-width: 150px; }

.sy-privacy-check label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--auth-ink);
    font-size: 14px;
}

.sy-privacy-check input { width: 18px; height: 18px; }
.sy-privacy-check a { color: var(--auth-blue); font-weight: 900; }

.sy-register-success {
    min-height: 390px;
    text-align: center;
    padding: 36px 20px;
}

.sy-success-icon {
    width: 76px;
    height: 76px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, #2f8b5b, #237147);
    font-size: 30px;
    box-shadow: 0 12px 26px rgba(35,113,71,.22);
}

.sy-register-success h2 {
    margin: 0 0 12px;
    color: var(--auth-blue-dark);
    font-size: 30px;
    font-weight: 950;
}

.sy-register-success h3 {
    margin: 0 0 24px;
    color: var(--auth-ink);
    font-size: 17px;
    line-height: 1.9;
    font-weight: 700;
}

@media (max-width: 700px) {
    .sy-study-login-body #form1 { padding: 8px; }
    .sy-auth-card { padding: 20px !important; border-radius: 18px !important; }
    .sy-auth-brand h1 { font-size: 23px; }
    .sy-auth-icon { width: 46px; height: 46px; flex-basis: 46px; }

    .sy-register-page { width: calc(100% - 20px); padding-top: 18px !important; }
    .sy-register-hero { min-height: 0; align-items: flex-start; flex-direction: column; padding: 22px; border-radius: 22px; }
    .sy-register-hero h1 { font-size: 30px; }
    .sy-register-login-link { width: 100%; }
    .sy-register-card { padding: 16px; border-radius: 22px; }
    .sy-register-card .step.step-round li p { min-height: 48px; padding: 7px; }
    .sy-register-card .step.step-round li p span { display: none; }
    .sy-register-field { grid-template-columns: minmax(0, 1fr); gap: 6px; }
    .sy-register-field label { min-height: auto; }
    .sy-register-field h4 { grid-column: 1; }
    .sy-register-captcha { grid-template-columns: minmax(0, 1fr) auto; }
    .sy-register-captcha label { grid-column: 1 / -1; }
    .sy-register-actions .btn-default { width: 100%; }
}

@media (max-width: 430px) {
    .sy-auth-brand { align-items: flex-start; }
    .sy-auth-note { display: none; }
    .sy-auth-options { align-items: flex-start; flex-direction: column; }
    .sy-auth-captcha-control { grid-template-columns: minmax(0, 1fr); }
    #studyLogin #btnRefreshSafeCode { justify-content: center; }
    .sy-register-captcha { grid-template-columns: minmax(0, 1fr); }
    .sy-register-captcha > a { justify-content: center; }
}
