/**
 * Jammy Registration — CSS
 * Mobile-first, matches Jammy Competitions Design System
 * Version: 1.0.0
 */

/* ═══════════════════════════════════════════════════════════
   CSS VARIABLES — Jammy Design System
   ═══════════════════════════════════════════════════════════ */

:root {
    --jr-primary: #E3243B;
    --jr-secondary: #C41E30;
    --jr-dark: #9A1B2C;
    --jr-black: #1a1a1a;
    --jr-white: #ffffff;
    --jr-light-grey: #f5f5f5;
    --jr-medium-grey: #e0e0e0;
    --jr-text-grey: #888888;
    --jr-green: #16a34a;
    --jr-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --jr-radius-lg: 14px;
    --jr-radius-md: 10px;
    --jr-radius-pill: 100px;
    --jr-shadow-card: 0 4px 20px rgba(0, 0, 0, 0.08);
    --jr-shadow-red: 0 4px 15px rgba(227, 36, 59, 0.3);
}


/* ═══════════════════════════════════════════════════════════
   WRAPPER / LAYOUT
   ═══════════════════════════════════════════════════════════ */

.jammy-auth-wrapper {
    max-width: 480px;
    margin: 0 auto;
    padding: 24px 16px 40px;
    font-family: var(--jr-font);
}

/* Hide default WooCommerce elements we don't need */
.woocommerce-account .woocommerce-form-login__rememberme,
.woocommerce-account .woocommerce-privacy-policy-text {
    display: none !important;
}


/* ═══════════════════════════════════════════════════════════
   AUTH CARD
   ═══════════════════════════════════════════════════════════ */

.jammy-auth-card {
    background: var(--jr-white);
    border-radius: var(--jr-radius-lg);
    padding: 24px 18px 28px;
    box-shadow: var(--jr-shadow-card);
}

.jammy-auth-header {
    text-align: center;
    margin-bottom: 22px;
}

.jammy-auth-header h2 {
    font-size: 21px;
    font-weight: 800;
    color: var(--jr-black);
    margin: 0 0 5px;
    letter-spacing: -0.3px;
    font-family: var(--jr-font);
}

.jammy-auth-header p {
    font-size: 13px;
    color: var(--jr-text-grey);
    margin: 0;
    line-height: 1.5;
}


/* ═══════════════════════════════════════════════════════════
   FORM GROUPS
   ═══════════════════════════════════════════════════════════ */

.jammy-form-group {
    margin-bottom: 10px;
}

.jammy-form-group label {
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--jr-black);
    margin-bottom: 4px;
    display: block;
    font-family: var(--jr-font);
}

.jammy-form-group label .required {
    color: var(--jr-primary);
    margin-left: 2px;
}

/* Side-by-side fields (first + last name) */
.jammy-form-row-half {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.jammy-form-row-half .jammy-form-group {
    margin-bottom: 0;
}


/* ═══════════════════════════════════════════════════════════
   INPUTS & SELECTS
   ═══════════════════════════════════════════════════════════ */

.jammy-auth-card input[type="text"],
.jammy-auth-card input[type="email"],
.jammy-auth-card input[type="password"],
.jammy-auth-card input[type="tel"],
.jammy-auth-card select {
    width: 100%;
    padding: 11px 14px;
    font-size: 14px;
    font-family: var(--jr-font);
    border: 1.5px solid var(--jr-medium-grey);
    border-radius: var(--jr-radius-md);
    background: var(--jr-light-grey);
    color: var(--jr-black);
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.jammy-auth-card input[type="text"]:focus,
.jammy-auth-card input[type="email"]:focus,
.jammy-auth-card input[type="password"]:focus,
.jammy-auth-card input[type="tel"]:focus,
.jammy-auth-card select:focus {
    border-color: var(--jr-primary);
    box-shadow: 0 0 0 3px rgba(227, 36, 59, 0.1);
    background: var(--jr-white);
}

.jammy-auth-card input::placeholder {
    color: var(--jr-text-grey);
}

/* Validation error state */
.jammy-auth-card input.jammy-field-error,
.jammy-auth-card select.jammy-field-error {
    border-color: var(--jr-primary);
    box-shadow: 0 0 0 3px rgba(227, 36, 59, 0.08);
}

/* Select dropdown arrow */
.jammy-auth-card select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
    cursor: pointer;
    color: var(--jr-black);
}

.jammy-auth-card select:invalid,
.jammy-auth-card select option[value=""][disabled] {
    color: var(--jr-text-grey);
}


/* ═══════════════════════════════════════════════════════════
   PASSWORD FIELD
   ═══════════════════════════════════════════════════════════ */

.jammy-password-wrapper {
    position: relative;
}

.jammy-password-wrapper input {
    padding-right: 54px !important;
}

.jammy-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--jr-text-grey);
    font-size: 12px;
    font-family: var(--jr-font);
    font-weight: 600;
    padding: 0;
    letter-spacing: 0.3px;
    transition: color 0.3s;
}

.jammy-password-toggle:hover {
    color: var(--jr-black);
}

/* Password strength rules */
.jammy-password-rules {
    margin-top: 6px;
}

.jammy-rule {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.jammy-rule-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--jr-medium-grey);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    flex-shrink: 0;
}

.jammy-rule.passed .jammy-rule-dot {
    background: var(--jr-green);
}

.jammy-rule.passed .jammy-rule-dot::after {
    content: '';
    display: block;
    width: 6px;
    height: 3px;
    border-left: 1.5px solid white;
    border-bottom: 1.5px solid white;
    transform: rotate(-45deg) translateY(-0.5px);
}

.jammy-rule-text {
    font-size: 11px;
    color: var(--jr-text-grey);
    font-weight: 500;
    transition: color 0.3s;
}

.jammy-rule.passed .jammy-rule-text {
    color: var(--jr-green);
}


/* ═══════════════════════════════════════════════════════════
   PHONE FIELD
   ═══════════════════════════════════════════════════════════ */

.jammy-phone-wrapper {
    display: flex;
    gap: 8px;
}

.jammy-phone-prefix {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 11px 10px;
    background: var(--jr-light-grey);
    border: 1.5px solid var(--jr-medium-grey);
    border-radius: var(--jr-radius-md);
    font-size: 13px;
    color: var(--jr-black);
    font-weight: 500;
    white-space: nowrap;
    font-family: var(--jr-font);
}

.jammy-flag {
    font-size: 15px;
    line-height: 1;
}

.jammy-phone-wrapper input {
    flex: 1;
    min-width: 0;
}


/* ═══════════════════════════════════════════════════════════
   DATE OF BIRTH
   ═══════════════════════════════════════════════════════════ */

.jammy-dob-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.4fr 1fr;
    gap: 8px;
}

.jammy-dob-wrapper select {
    font-size: 13px;
    padding: 11px 10px;
}


/* ═══════════════════════════════════════════════════════════
   DIVIDER
   ═══════════════════════════════════════════════════════════ */

.jammy-divider {
    height: 1px;
    background: var(--jr-medium-grey);
    margin: 14px 0 16px;
}


/* ═══════════════════════════════════════════════════════════
   CHECKBOXES
   ═══════════════════════════════════════════════════════════ */

.jammy-checkbox-group {
    margin-bottom: 12px;
}

.jammy-checkbox-group:last-of-type {
    margin-bottom: 22px;
}

.jammy-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.5;
    color: #444;
    font-family: var(--jr-font);
}

/* Hide native checkbox */
.jammy-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* Custom checkmark */
.jammy-checkmark {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 5px;
    border: 1.5px solid var(--jr-medium-grey);
    background: var(--jr-light-grey);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    margin-top: 1px;
    position: relative;
}

.jammy-checkbox input:checked + .jammy-checkmark {
    background: linear-gradient(135deg, var(--jr-primary) 0%, var(--jr-secondary) 100%);
    border-color: var(--jr-primary);
    box-shadow: 0 2px 8px rgba(227, 36, 59, 0.25);
}

.jammy-checkbox input:checked + .jammy-checkmark::after {
    content: '';
    display: block;
    width: 7px;
    height: 4px;
    border-left: 2px solid white;
    border-bottom: 2px solid white;
    transform: rotate(-45deg) translateY(-1px);
}

/* Error state for checkbox */
.jammy-checkbox input.jammy-field-error + .jammy-checkmark {
    border-color: var(--jr-primary);
}

.jammy-checkbox-text {
    flex: 1;
}

.jammy-checkbox-text strong {
    color: var(--jr-black);
}

.jammy-checkbox-text a {
    color: var(--jr-primary);
    text-decoration: underline;
    font-weight: 500;
}

.jammy-checkbox-text a:hover {
    color: var(--jr-secondary);
}


/* ═══════════════════════════════════════════════════════════
   LOGIN-SPECIFIC
   ═══════════════════════════════════════════════════════════ */

.jammy-login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    margin-top: 4px;
}

.jammy-remember-me {
    font-size: 13px !important;
}

.jammy-lost-password {
    font-size: 13px;
    color: var(--jr-primary);
    text-decoration: none;
    font-weight: 600;
    font-family: var(--jr-font);
    transition: color 0.3s;
}

.jammy-lost-password:hover {
    color: var(--jr-secondary);
}


/* ═══════════════════════════════════════════════════════════
   SUBMIT BUTTON
   ═══════════════════════════════════════════════════════════ */

.jammy-submit-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--jr-primary) 0%, var(--jr-secondary) 100%);
    color: var(--jr-white);
    border: none;
    border-radius: var(--jr-radius-pill);
    font-size: 15px;
    font-weight: 700;
    font-family: var(--jr-font);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    box-shadow: var(--jr-shadow-red);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

/* Gloss overlay */
.jammy-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 50%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.15), rgba(255,255,255,0));
    border-radius: var(--jr-radius-pill) var(--jr-radius-pill) 0 0;
    pointer-events: none;
}

.jammy-submit-btn span {
    position: relative;
    z-index: 1;
}

.jammy-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(227, 36, 59, 0.4);
}

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


/* ═══════════════════════════════════════════════════════════
   AUTH TOGGLE (Login/Register switch)
   ═══════════════════════════════════════════════════════════ */

.jammy-auth-toggle {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: var(--jr-text-grey);
    font-family: var(--jr-font);
}

.jammy-auth-toggle a {
    color: var(--jr-primary);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.3s;
}

.jammy-auth-toggle a:hover {
    color: var(--jr-secondary);
}


/* ═══════════════════════════════════════════════════════════
   WOOCOMMERCE NOTICE OVERRIDES
   ═══════════════════════════════════════════════════════════ */

.woocommerce-account .woocommerce-error,
.woocommerce-account .woocommerce-message,
.woocommerce-account .woocommerce-info {
    max-width: 480px;
    margin: 0 auto 16px;
    border-radius: var(--jr-radius-md);
    font-family: var(--jr-font);
    font-size: 13px;
    padding: 12px 16px;
}

.woocommerce-account .woocommerce-error {
    border-left: 4px solid var(--jr-primary);
    background: rgba(227, 36, 59, 0.05);
    color: var(--jr-dark);
}

.woocommerce-account .woocommerce-error::before {
    color: var(--jr-primary);
}


/* ═══════════════════════════════════════════════════════════
   INLINE FIELD ERROR MESSAGES
   ═══════════════════════════════════════════════════════════ */

.jammy-field-error-msg {
    color: var(--jr-primary);
    font-size: 11px;
    margin-top: 3px;
    display: block;
    font-family: var(--jr-font);
    font-weight: 500;
}


/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — Desktop
   ═══════════════════════════════════════════════════════════ */

@media (min-width: 768px) {
    .jammy-auth-wrapper {
        padding: 48px 16px 60px;
    }

    .jammy-auth-card {
        padding: 32px 28px 36px;
    }

    .jammy-auth-header h2 {
        font-size: 23px;
    }
}


/* ═══════════════════════════════════════════════════════════
   HIDE DEFAULT WOOCOMMERCE CHROME
   ═══════════════════════════════════════════════════════════ */

/* Hide WooCommerce default registration/login headings if theme outputs them */
.woocommerce-account .entry-header,
.woocommerce-account h1.entry-title,
.woocommerce-account .page-header {
    display: none !important;
}

/* Hide any default WooCommerce form styling that leaks through */
.woocommerce-form-register .form-row,
.woocommerce-form-login .form-row {
    padding: 0 !important;
    margin: 0 !important;
}

/* Ensure Astra theme doesn't override our layout */
.woocommerce-account .woocommerce {
    max-width: 100%;
    padding: 0;
}
