:root {
    --blue: #1976d2;
    --blueDark: #1f68ce;
    --bgTop: #e0f1ff;
    --bgBottom: #276bac;
    --cardSize: 625px;
    --circleSize: 260px;
    --circleOffsetY: 80px;
    --inputHeight: 42px;
    --inputWidthMobile: 240px;
    --inputWidthTablet: 300px;
    --inputWidthDesktop: 320px;
    --logoHeightDesktop: 150px;
    --logoHeightMobile: 90px;
}

body {
    display: flex;
    min-height: 100vh;
    font-family: system-ui,
        -apple-system, Segoe UI, Roboto,
        sans-serif;
    margin: 0;
    background: linear-gradient(90deg, #cfe9ff 0%, #bde6ff 100%);
    background-attachment: fixed;
    background-repeat: no-repeat;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    right: 0;
    width: 60vw;
    height: 60vh;
    display: none;
    pointer-events: none;
    z-index: 0;
}

.container,
.card,
input,
button {
    box-sizing: border-box;
}

.form-row input {
    height: var(--inputHeight);
}

.hero {
    flex: 1;
    background: none;
}

.brand {
    text-align: center;
}

.brand h1 {
    margin: 0;
    font-size: 36px;
    color: var(--blueDark);
    letter-spacing: 2px;
}

.brand p {
    margin: 4px 0 0;
    color: #3a6ea5;
    font-size: 13px;
}

.logo-img {
    height: 200px;
    display: inline-block;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
    flex-direction: column;
}

.card-logo {
    height: var(--logoHeightDesktop);
    display: block;
}

.card-tagline {
    margin-top: 2px;
    margin-bottom: 8px;
    font-size: 16px;
    color: #000;
    font-weight: 600;
    letter-spacing: .4px;
    font-style: normal;
    font-family: "Times New Roman", Times, serif;
    text-transform: none;
    line-height: 1.3;
    text-align: center;
    white-space: nowrap;
    min-height: 20px;
}

.wrapper {
    flex: 1;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 100vh;
    padding-top: 0;
}

.container {
    max-width: none;
    width: auto;
    margin: 0 auto;
    padding: 16px;
    position: relative;
    z-index: 10;
}

.card {
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
    background: #fff;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: visible;
    gap: 0;
}

.form-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
    margin-bottom: 8px;
}

.form-icon {
    display: none;
}

.form-icon svg {
    width: 16px;
    height: 16px;
    stroke: #999;
    fill: none;
    stroke-width: 2;
}

.form-label-ja {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
    margin-right: 0;
    margin-left: 0;
    min-width: 88px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    letter-spacing: -0.2px;
    font-weight: 500;
}

.label-icon-img {
    width: 28px;
    height: 28px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 2px;
}
.label-icon-img-user {
    width: 28px;
    height: 28px;
    transform: scale(1.18);
    transform-origin: center;
}
.short-input {
    width: 100%;
}

.input-suffix {
    margin-left: 6px;
    color: #556e8b;
    font-size: 14px;
    white-space: nowrap;
}

label {
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-row>label {
    min-width: 92px;
}

.label-icon {
    width: 18px;
    height: 18px;
    stroke: #666;
    fill: none;
    stroke-width: 2;
}

input {
    padding: 10px 12px;
    font-size: 16px;
    border: 1px solid #c9d6ea;
    border-radius: 8px;
    width: 100%;
    background: #f7fbff;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.form-row input:focus,
.form-row input:focus-visible {
    outline: none;
    border-color: #7aa7e6;
    box-shadow: 0 0 0 2px rgba(122, 167, 230, 0.25);
}

.row-inline {
    display: flex;
    gap: 8px;
    align-items: center;
}

button {
    padding: 12px 14px;
    border-radius: 8px;
    border: none;
    background: var(--blueDark);
    color: #fff;
    font-weight: 700;
    width: 100%;
}

button.secondary {
    background: #666;
}

#error {
    display: none;
    color: #b00020;
    margin-bottom: 8px;
}

#success {
    color: #2e7d32;
    margin-top: 8px;
}

.input-with-icon {
    position: relative;
}

.form-row input {
    margin: 0;
    width: 100%;
}

.input-with-icon {
    margin: 0;
    width: 100%;
    max-width: 100%;
    flex: 1 1 auto;
    min-width: 0;
}

.input-with-icon input {
    padding-right: 40px;
}

.remember-row .remember-label {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    font-size: 13px;
    line-height: 1.4;
}

.remember-row {
    align-items: flex-start;
}

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

.actions .btn[disabled] {
    background: #0d2c5b;
    color: #fff;
    opacity: 1;
    cursor: default;
    pointer-events: auto;
    box-shadow: none;
}

.actions .btn[disabled]:hover {
    background: #154c8a;
}

.actions {
    margin-top: 4px;
    display: flex;
    justify-content: center;
}

.actions .btn {
    width: fit-content;
    min-width: 0;
    padding: 12px 24px;
    white-space: nowrap;
    background: #0d2c5b;
    border-radius: 10px;
    font-size: 16px;
    margin: 0 auto;
    cursor: pointer;
    transition: background .2s ease, box-shadow .2s ease;
}

.actions .btn:not([disabled]):hover {
    background: #154c8a;
    box-shadow: 0 6px 14px rgba(0, 0, 0, .16);
    transform: translateY(-1px);
}

.actions .btn:not([disabled]):active {
    background: #103b7a;
    box-shadow: 0 3px 8px rgba(0, 0, 0, .18);
    transform: translateY(0);
}

.actions .btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, .35);
}

.icon-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 0;
}

.icon-btn svg {
    width: 22px;
    height: 22px;
    stroke: #666;
    fill: none;
    stroke-width: 2;
}

.notes {
    color: #556e8b;
    font-size: 12px;
    line-height: 1.6;
    margin-top: 4px;
    margin-bottom: 6px;
    text-align: left;
    max-width: 560px;
    width: 92%;
    margin-left: auto;
    margin-right: auto;
}

.terms-note {
    color: #556e8b;
    font-size: 13px;
    line-height: 1.7;
    text-align: center;
    margin-top: 4px;
    margin-bottom: 6px;
}

#status {
  display: grid;
  place-items: center;
  min-height: 40px;
}
.page-spinner {
  position: fixed;
  inset: 0;
  background: #fff;
  display: grid;
  place-items: center;
  z-index: 3000;
}
.page-spinner[hidden] {
  display: none;
}
.lds-spinner {
  color: #555;
  display: inline-block;
  position: relative;
  width: 64px;
  height: 64px;
}
.lds-spinner div {
  transform-origin: 32px 32px;
  animation: lds-spinner 1.2s linear infinite;
}
.lds-spinner div:after {
  content: "";
  display: block;
  position: absolute;
  top: 3px;
  left: 29px;
  width: 6px;
  height: 14px;
  border-radius: 20%;
  background: #666;
}
.lds-spinner div:nth-child(1) { transform: rotate(0deg); animation-delay: -1.1s; }
.lds-spinner div:nth-child(2) { transform: rotate(30deg); animation-delay: -1.0s; }
.lds-spinner div:nth-child(3) { transform: rotate(60deg); animation-delay: -0.9s; }
.lds-spinner div:nth-child(4) { transform: rotate(90deg); animation-delay: -0.8s; }
.lds-spinner div:nth-child(5) { transform: rotate(120deg); animation-delay: -0.7s; }
.lds-spinner div:nth-child(6) { transform: rotate(150deg); animation-delay: -0.6s; }
.lds-spinner div:nth-child(7) { transform: rotate(180deg); animation-delay: -0.5s; }
.lds-spinner div:nth-child(8) { transform: rotate(210deg); animation-delay: -0.4s; }
.lds-spinner div:nth-child(9) { transform: rotate(240deg); animation-delay: -0.3s; }
.lds-spinner div:nth-child(10) { transform: rotate(270deg); animation-delay: -0.2s; }
.lds-spinner div:nth-child(11) { transform: rotate(300deg); animation-delay: -0.1s; }
.lds-spinner div:nth-child(12) { transform: rotate(330deg); animation-delay: 0s; }
@keyframes lds-spinner {
  0% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes linkBlink {
    0% {
        opacity: 1;
    }

    45% {
        opacity: .82;
    }

    100% {
        opacity: 1;
    }
}


.circle {
    position: absolute;
    border-radius: 50%;
    background: var(--blueDark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .20);
    z-index: 20;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    width: var(--circleSize);
    height: var(--circleSize);
    left: calc(50% + (var(--cardSize) / 2) - 80px);
    top: calc(50% + (var(--cardSize) / 4) + var(--circleOffsetY));
    transform: translate(-50%, -50%);
}

.circle ul {
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.circle li {
    margin: 0;
}

.circle-text {
    color: #fff;
    text-align: center;
    font-size: 11px;
    line-height: 1.5;
    padding: 8px 12px;
}

.circle a {
    color: #fff;
    text-decoration: underline;
    font-size: 13px;
    line-height: 1.6;
    display: block;
    padding: 2px 0;
    border-radius: 6px;
    font-weight: 300;
    letter-spacing: .1px;
    font-family: "Hiragino Kaku Gothic ProN", "Meiryo", "Noto Sans JP", system-ui, -apple-system, "Segoe UI", "Roboto", "Arial", sans-serif;
    text-shadow: none;
    transition: opacity .12s ease, color .12s ease;
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.circle a:visited {
    color: #fff;
}

.circle a:hover {
    opacity: 1;
    animation: linkBlink .22s ease-in-out 1;
}

.card-content {
    width: 560px;
    max-width: 70%;
    margin-top: -14px;
}


@media (max-width: 480px) {
    :root {
        --circleMobileTopAdjust: 18vh;
        --circleMobileLeftAdjust: 0;
        --circleMobileBelowMargin: 16px;
        --cardMobileLift: 0px;
        --cardMobileShiftX: 0px;
        --cardSize: 100%;
        --contentWidthMobile: 100%;
        --contentTextWidthMobile: 100%;
    }
    html,
    body {
        height: 100dvh;
        overflow: hidden;
    }
    body {
        flex-direction: column;
        overflow: hidden;
    }

    .hero {
        display: none;
    }

    .wrapper {
        height: 100dvh;
        min-height: 100dvh;
        padding: 0;
        justify-content: flex-start;
        align-items: center;
        flex-direction: column;
        transform: none;
        position: relative;
        overflow: hidden;
    }

    .container {
        margin: 0 auto 8px;
    }

    .short-input {
        width: 100%;
    }

    /* merged into single .circle definition below to avoid conflicting positions */

    input {
        font-size: 15px;
        padding: 8px 10px;
    }

    input {
        font-size: 15px;
        padding: 8px 10px;
    }

    .circle {
        position: static;
        width: 244px;
        height: 244px;
        margin: 10px auto 0;
        transform: scale(0.88);
        transform-origin: top center;
        z-index: 20;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .circle ul {
        gap: 2px;
        width: 100%;
    }

    .circle li {
        min-height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .circle a {
        display: block;
        width: 92%;
        margin: 0 auto;
        font-size: 13px;
        line-height: 1.6;
        text-align: center;
        white-space: nowrap;
        word-break: keep-all;
        overflow-wrap: normal;
        padding: 3px 0;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    .circle a:hover {
        opacity: 1;
        animation: none;
    }

    .remember-row .remember-label {
        white-space: normal;
    }

    .logo-img {
        height: 96px;
    }

    .card-logo {
        height: var(--logoHeightMobile);
        min-height: var(--logoHeightMobile);
        margin: 0 auto;
        display: block;
    }

    .card-tagline {
        font-size: clamp(12px, 3.6vw, 14px);
        margin-top: 2px;
        margin-bottom: 6px;
        line-height: 1.3;
        text-align: center;
        min-height: 20px;
    }

    .card {
        width: 100vw;
        max-width: 100vw;
        height: auto;
        border-radius: 0;
        padding: 10px 10px 12px;
        box-sizing: border-box;
        overflow: visible;
        transform: none;
        display: block;
        text-align: left;
    }

    .card-content { width: 100%; max-width: 100%; min-width: 0; margin: 0 auto; }
    .form-row,
    .actions {
        max-width: 100%;
        min-width: 0;
        margin-left: auto;
        margin-right: auto;
    }

    .form-row:not(.actions) {
        display: grid;
        grid-template-columns: 118px minmax(0, 1fr);
        align-items: center;
        gap: 6px;
        width: 100%;
        margin-bottom: 8px;
    }

    .card-header {
        width: 100%;
        display: grid;
        place-items: center;
        margin: 0 0 6px 0;
        min-height: calc(var(--logoHeightMobile) + 20px);
        flex: none;
    }

    .actions {
        width: 100%;
        margin-top: 8px;
    }
    .actions .btn {
        width: fit-content !important;
    }

    
    .notes {
        margin-top: 8px;
        margin-bottom: 8px;
        white-space: normal;
        word-break: break-word;
        overflow-wrap: anywhere;
        font-size: 12px;
        min-height: 48px;
    }
    .terms-note {
        max-width: 100%;
        margin: 0 auto 8px;
        text-align: center;
        white-space: normal;
        font-size: 12px;
        min-height: 40px;
    }
    .terms-note br {
        display: inline;
    }

    .form-icon {
        width: 14px;
        height: 14px;
        margin-right: 4px;
    }

    .form-icon svg {
        width: 14px;
        height: 14px;
        stroke-width: 1.6;
    }

    .label-icon {
        width: 14px;
        height: 14px;
        stroke-width: 1.6;
    }

    .icon-btn {
        width: 24px;
        height: 24px;
    }

    .icon-btn svg {
        width: 20px;
        height: 20px;
    }

    .form-row input {
        background: #eef5ff;
        font-size: 15px;
        padding: 12px 14px;
    }

    .form-row>label {
        width: 88px;
        min-width: 88px;
        white-space: nowrap;
        text-align: left;
        margin-right: 6px;
        flex: 0 0 auto;
    }

    .input-with-icon {
        flex: 1 1 auto !important;
        width: auto !important;
        max-width: none !important;
        min-width: 0 !important;
    }

    .form-label-ja {
        width: auto;
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 3px;
        font-size: 12px;
        white-space: nowrap;
        overflow: visible;
        text-overflow: clip;
        margin-right: 6px;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    .label-icon-img,
    .label-icon-img-user {
        width: 22px;
        height: 22px;
    }

    .form-row input {
        width: 100%;
        margin: 0;
    }
}

@media (min-width: 481px) and (max-width: 640px) {
    :root {
        --cardSize: min(88vw, 560px);
        --contentWidthTablet: 56%;
        --contentWidthTabletText: 72%;
    }
    body {
        flex-direction: column;
    }

    .hero {
        display: none;
    }

    .wrapper {
        padding-bottom: 200px;
        flex-direction: column;
        align-items: center;
    }

    .card-content {
        max-width: 420px;
        margin-left: auto;
        margin-right: auto;
    }
    .form-row:not(.actions) {
        display: grid;
        grid-template-columns: 118px minmax(0, 1fr);
        align-items: center;
        column-gap: 8px;
    }
    .input-with-icon {
        flex: 1 1 auto;
        width: auto;
        max-width: none;
        min-width: 0;
    }
    .form-row,
    .actions {
        max-width: 420px;
        margin-left: auto;
        margin-right: auto;
    }
    .actions .btn {
        width: fit-content !important;
    }

    .card {
        flex: 0 0 auto;
        border-radius: 16px;
        width: var(--cardSize);
        height: auto;
        max-width: none;
    }

    .circle {
        position: static;
        width: var(--circleSize);
        height: var(--circleSize);
        margin: 24px auto 0;
        transform: none;
    }
    .terms-note {
        max-width: var(--contentWidthTabletText);
        margin: 0 auto 10px;
        text-align: center;
    }
    .terms-note br {
        display: none;
    }

    .circle ul {
        gap: 2px;
        width: 100%;
    }

    .circle li {
        min-height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .circle a {
        display: block;
        width: 92%;
        margin: 0 auto;
        font-size: 13px;
        line-height: 1.6;
        text-align: center;
        white-space: nowrap;
        word-break: keep-all;
        overflow-wrap: normal;
        padding: 3px 0;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    .circle a:hover {
        opacity: 1;
        animation: none;
    }

    .form-label-ja {
        width: auto;
        min-width: 0;
        display: inline-flex;
        align-items: center;
        overflow: visible;
        text-overflow: clip;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
}

@media (max-width: 900px) {
    .hero {
        height: 28vh;
    }
}

@media (min-width: 641px) {
    .wrapper {
        align-items: center;
        justify-content: center;
        width: 100%;
        max-width: none;
        margin: 0 auto;
        flex: none;
        padding-left: 0;
        padding-right: 0;
        flex-direction: column;
    }

    .hero {
        display: none;
    }

    .container {
        margin: 0 auto 24px;
    }

    .card-content {
        width: 100%;
        max-width: 480px;
        margin-left: auto;
        margin-right: auto;
    }
    .form-row,
    .actions {
        max-width: 480px;
        margin-left: auto;
        margin-right: auto;
    }
    .actions .btn {
        width: fit-content !important;
    }
    .input-with-icon {
        margin: 0;
        width: var(--inputWidthDesktop);
        max-width: var(--inputWidthDesktop);
        flex: 0 0 auto;
    }

    .card {
        margin: 0 auto;
        width: var(--cardSize);
        height: var(--cardSize);
        max-width: none;
        box-sizing: border-box;
        border-radius: 50%;
        display: grid;
        place-items: center;
        text-align: center;
        padding: 24px;
        overflow: visible;
    }

    .circle {
        position: absolute;
        left: calc(50% + (var(--cardSize) / 2) - 80px);
        top: calc(50% + (var(--cardSize) / 4) + var(--circleOffsetY));
        transform: translate(-50%, -50%);
        width: var(--circleSize);
        height: var(--circleSize);
        z-index: 20;
        border-radius: 50%;
        background: var(--blueDark);
        box-shadow: 0 12px 28px rgba(0, 0, 0, .20);
        writing-mode: horizontal-tb;
        text-orientation: mixed;
    }
}
