/* AMG phones: the customer portal, the salesman's screens and the sign-in page.
   Loaded only where money tracking is off, so OEW's screens are untouched.
   UI/UX Pro Max mobile rules: 44px+ touch targets, 16px+ inputs (no zoom on focus),
   no sideways scrolling, the main action always within thumb reach, safe areas,
   press feedback, reduced motion respected. */

:root{--amg-font:"Segoe UI Variable Text","Segoe UI",system-ui,-apple-system,"Helvetica Neue",Roboto,Tahoma,Arial,sans-serif}
.field-body,.login-body{font-family:var(--amg-font);-webkit-text-size-adjust:100%;-webkit-font-smoothing:antialiased}
.field-body *,.login-body *{-webkit-tap-highlight-color:transparent}

/* ---- Header: one compact line ---- */
.field-top{gap:8px;padding:calc(8px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));min-height:60px;box-shadow:0 2px 10px rgba(8,17,32,.18)}
.field-title strong{font-size:17px;line-height:1.25}
.field-title small{font-size:12px;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.field-back{width:44px;height:44px;flex:0 0 44px}
.field-logo img{height:28px!important;max-width:72px!important}
.field-language button,.field-signout{min-height:44px;min-width:44px;border-radius:10px;font-size:14px;padding:0 10px}
.field-signout{display:inline-flex;align-items:center;justify-content:center;gap:6px}
.field-signout .icon{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
@media(max-width:420px){
  .field-signout span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  .field-signout{padding:0;width:44px}
  .field-language button{padding:0 8px;font-size:13px}
  .field-logo{display:none!important}
}

/* ---- Content ---- */
.field-main{padding:16px max(14px, env(safe-area-inset-left)) calc(28px + env(safe-area-inset-bottom))}
.field-body input[type=text],.field-body input[type=tel],.field-body input[type=date],.field-body input[type=password],
.field-body input[type=email],.field-body input[type=search],.field-body textarea{
  width:100%;min-height:52px;border:1px solid #d6dee9;border-radius:12px;padding:12px 14px;font-size:16px;
  background:#fff;color:var(--ink);font-family:inherit}
.field-body input[type=date]{appearance:none;-webkit-appearance:none;display:block}
.field-body textarea{min-height:88px;line-height:1.45}
.field-body input:focus,.field-body textarea:focus{outline:none;border-color:#1d5fd0;box-shadow:0 0 0 4px rgba(29,95,208,.14)}
.field-label{font-size:15px}
.field-label small,.field-step h2 small{font-weight:500}
.field-card,.field-step{border-radius:16px;box-shadow:0 1px 2px rgba(15,23,42,.04)}
.field-items li{font-size:16px;align-items:baseline}
.field-items li strong{white-space:nowrap}
.field-what{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}

/* Links at the bottom of a page are buttons a thumb can hit. */
.field-footnote a{display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:0 18px;border-radius:12px;
  background:#fff;border:1px solid #d6dee9;font-weight:600;font-size:15px;text-decoration:none}
.field-footnote a:active{background:#eef4ff}

/* The send button stays within reach while a long form is filled in. */
.field-form>.field-send{position:sticky;bottom:calc(10px + env(safe-area-inset-bottom));z-index:10;
  box-shadow:0 10px 26px rgba(15,23,42,.22)}
.field-send,.field-action{font-family:inherit}

/* Press feedback, so a tap is felt */
.field-action,.field-send,.field-list a,.field-addline,.field-photo-button,.field-line-photo-button,.field-footnote a,
.field-card .button,.portal-files a,.field-signout,.field-language button,.field-back{transition:transform .12s ease,background-color .15s,box-shadow .15s}
.field-action:active,.field-send:active,.field-list a:active,.field-card .button:active,.portal-files a:active{transform:scale(.98)}
.field-list a{border-radius:14px;padding:16px}

/* Arabic: the browser already lays rows right to left; the old reversal turned them back. */
[dir=rtl] .field-items li,[dir=rtl] .field-meta,[dir=rtl] .field-qty{flex-direction:row}
[dir=rtl] .field-signout .icon{transform:scaleX(-1)}

/* ---- Sign-in page on a phone: the company on top, the form full width ---- */
@media(max-width:760px){
  .login-body{display:flex!important;flex-direction:column;min-height:100vh;min-height:100dvh}
  .login-brand{display:flex!important;flex-direction:row;align-items:center;gap:14px;padding:calc(18px + env(safe-area-inset-top)) 20px 18px!important;justify-content:flex-start}
  .login-brand>h1,.login-brand>p:not(.login-company),.login-steps{display:none!important}
  .login-logo{margin:0!important;align-self:center!important}
  .login-logo img{height:44px!important;max-width:120px!important}
  .login-company{margin:0!important;font-size:16px!important}
  .login-brand>.brand{margin:0!important;font-size:18px!important}
  .login-form{display:block!important;padding:26px 20px calc(30px + env(safe-area-inset-bottom))!important;flex:1}
  .login-card{width:100%!important;max-width:440px;margin:0 auto}
  .login-card h1{font-size:26px}
  .login-card input:not([type=checkbox]):not([type=hidden]){min-height:52px;font-size:16px;border-radius:12px}
  .login-card .button{min-height:54px;font-size:16px;border-radius:12px}
  .login-card .language-switch button{min-height:44px;padding:0 14px}
  .login-footer{font-size:13px!important;line-height:1.5}
}

@media (prefers-reduced-motion:no-preference){
  @keyframes amg-rise{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
  .field-main>*{animation:amg-rise .32s cubic-bezier(.16,1,.3,1) backwards}
  .field-main>:nth-child(2){animation-delay:.04s}.field-main>:nth-child(3){animation-delay:.08s}.field-main>:nth-child(n+4){animation-delay:.12s}
  .field-list>li{animation:amg-rise .32s cubic-bezier(.16,1,.3,1) backwards}
  .field-list>li:nth-child(2){animation-delay:.04s}.field-list>li:nth-child(3){animation-delay:.08s}.field-list>li:nth-child(n+4){animation-delay:.12s}
}
@media (prefers-reduced-motion:reduce){.field-body *,.login-body *{animation:none!important;transition:none!important}}

/* A greeting by name at the top of the salesman's and the customer's home screens. */
.portal-welcome{margin:4px 0 14px}
.portal-welcome h1{font-size:22px;letter-spacing:-.4px;margin:0 0 4px}
[dir=rtl] .portal-welcome h1{letter-spacing:0}
.portal-welcome p{margin:0;color:#5b6b80;font-size:14px;line-height:1.5}
